@@ -100,13 +100,13 @@ if [ -d "${AppleJavaFolder}" ]; then
100100 JVMMainClass=` /usr/libexec/PlistBuddy -c " print :Java:MainClass" ${InfoPlistFile} `
101101
102102 # read the JVM Options
103- JVMOptions=` /usr/libexec/PlistBuddy -c " print :Java:Properties" ${InfoPlistFile} | grep " =" | sed ' s/^ */-D/g' | tr ' \n' ' ' | sed ' s/ */ /g' | sed ' s/ = /=/g' `
103+ JVMOptions=` /usr/libexec/PlistBuddy -c " print :Java:Properties" ${InfoPlistFile} | grep " =" | sed ' s/^ */-D/g' | tr ' \n' ' ' | sed ' s/ */ /g' | sed ' s/ = /=/g' | xargs `
104104
105105 # read the JVM Default Options
106- JVMDefaultOptions=` /usr/libexec/PlistBuddy -c " print :Java:VMOptions" ${InfoPlistFile} `
106+ JVMDefaultOptions=` /usr/libexec/PlistBuddy -c " print :Java:VMOptions" ${InfoPlistFile} | xargs `
107107
108108 # read the JVM Arguments
109- JVMArguments=` /usr/libexec/PlistBuddy -c " print :Java:Arguments" ${InfoPlistFile} `
109+ JVMArguments=` /usr/libexec/PlistBuddy -c " print :Java:Arguments" ${InfoPlistFile} | xargs `
110110
111111
112112# read Info.plist in Oracle style
@@ -119,13 +119,13 @@ elif [ -d "${OracleJavaFolder}" ]; then
119119 JVMMainClass=` /usr/libexec/PlistBuddy -c " print :JVMMainClassName" ${InfoPlistFile} `
120120
121121 # read the JVM Options
122- JVMOptions=` /usr/libexec/PlistBuddy -c " print :JVMOptions" ${InfoPlistFile} | grep " -" | tr ' \n' ' ' | sed ' s/ */ /g' `
122+ JVMOptions=` /usr/libexec/PlistBuddy -c " print :JVMOptions" ${InfoPlistFile} | grep " -" | tr ' \n' ' ' | sed ' s/ */ /g' | xargs `
123123
124124 # read the JVM Default Options
125- JVMDefaultOptions=` /usr/libexec/PlistBuddy -c " print :JVMDefaultOptions" ${InfoPlistFile} | grep -o " \-.*" | tr ' \n' ' ' `
125+ JVMDefaultOptions=` /usr/libexec/PlistBuddy -c " print :JVMDefaultOptions" ${InfoPlistFile} | grep -o " \-.*" | tr ' \n' ' ' | xargs `
126126
127127 # read the JVM Arguments
128- JVMArguments=` /usr/libexec/PlistBuddy -c " print :JVMArguments" ${InfoPlistFile} | tr ' \n' ' ' | sed -E ' s/Array \{ *(.*) *\}/\1/g' | sed ' s/ */ /g' `
128+ JVMArguments=` /usr/libexec/PlistBuddy -c " print :JVMArguments" ${InfoPlistFile} | tr ' \n' ' ' | sed -E ' s/Array \{ *(.*) *\}/\1/g' | sed ' s/ */ /g' | xargs `
129129
130130fi
131131
@@ -184,13 +184,13 @@ elif [ -x "$JAVACMD" ]; then
184184 # - main class
185185 # - JVM arguments
186186 exec " $JAVACMD " \
187- -cp " ${JVMClasspath} " \
188- -Xdock:icon=" $PROGDIR /../Resources/${CFBundleIconFile} " \
189- -Xdock:name=" ${CFBundleName} " \
190- " ${JVMOptions} " \
191- " ${JVMDefaultOptions} " \
192- " ${JVMMainClass} " \
193- " ${JVMArguments} "
187+ -cp " ${JVMClasspath} " \
188+ -Xdock:icon=" $PROGDIR /../Resources/${CFBundleIconFile} " \
189+ -Xdock:name=" ${CFBundleName} " \
190+ ${JVMOptions: + " $JVMOptions " } \
191+ ${JVMDefaultOptions: + " $JVMDefaultOptions " } \
192+ " ${JVMMainClass} " \
193+ ${JVMArguments: + " $JVMArguments " }
194194
195195
196196else
0 commit comments