Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 367fc25

Browse files
committed
If the JavaX key is used, then replace occurrences of $APP_ROOT with its content in JVMOptions and Properties so as to match the Oracle format. Also, minor grammar issues.
1 parent a8b1a6d commit 367fc25

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ You should get a functional Mac Application Bundle working with both Java distri
108108
> If you don't want to care about compatibility issues between OS X and Java versions, better use my JarBundler fork (see next example).
109109
110110
### My JarBundler fork (v2.4) example
111-
Download the latest release of my JarBundler fork [from it's github repo](https://github.com/tofi86/Jarbundler) and replace your old JarBundler library with the new one.
111+
Download the latest release of my JarBundler fork [from its github repo](https://github.com/tofi86/Jarbundler) and replace your old JarBundler library with the new one.
112112

113113
Then place the `universalJavaApplicationStub` from this repo in your build resources folder and link it in your ANT task (attribute `stubfile`). Don't forget to set the newly introduced `useJavaXKey` option:
114114
```XML

src/universalJavaApplicationStub

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ if [ $exitcode -eq 0 ]; then
158158

159159
# read the JVM Options
160160
JVMOptions=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:Properties" "${InfoPlistFile}" 2> /dev/null | grep " =" | sed 's/^ */-D/g' | tr '\n' ' ' | sed 's/ */ /g' | sed 's/ = /=/g' | xargs`
161+
# replace occurences of $APP_ROOT with its content
162+
JVMOptions=`eval "echo ${JVMOptions}"`
161163

162164
# read StartOnMainThread
163165
JVMStartOnMainThread=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:StartOnMainThread" "${InfoPlistFile}" 2> /dev/null`
@@ -181,9 +183,11 @@ if [ $exitcode -eq 0 ]; then
181183

182184
# read the JVM Arguments
183185
JVMArguments=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:Arguments" "${InfoPlistFile}" 2> /dev/null | xargs`
186+
# replace occurences of $APP_ROOT with its content
187+
JVMArguments=`eval "echo ${JVMArguments}"`
184188

185-
# read the Java version we want to find
186-
JVMVersion=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:JVMVersion" "${InfoPlistFile}" 2> /dev/null | xargs`
189+
# read the Java version we want to find
190+
JVMVersion=`/usr/libexec/PlistBuddy -c "print ${JavaKey}:JVMVersion" "${InfoPlistFile}" 2> /dev/null | xargs`
187191

188192
# read Info.plist in Oracle style
189193
else
@@ -200,7 +204,7 @@ else
200204

201205
# read the JVM Options
202206
JVMOptions=`/usr/libexec/PlistBuddy -c "print :JVMOptions" "${InfoPlistFile}" 2> /dev/null | grep " -" | tr -d '\n' | sed 's/ */ /g' | xargs`
203-
# replace occurances of $APP_ROOT with it's content
207+
# replace occurences of $APP_ROOT with its content
204208
JVMOptions=`eval "echo ${JVMOptions}"`
205209

206210
JVMClassPath="${JavaFolder}/*"
@@ -210,7 +214,7 @@ else
210214

211215
# read the JVM Arguments
212216
JVMArguments=`/usr/libexec/PlistBuddy -c "print :JVMArguments" "${InfoPlistFile}" 2> /dev/null | tr -d '\n' | sed -E 's/Array \{ *(.*) *\}/\1/g' | sed 's/ */ /g' | xargs`
213-
# replace occurances of $APP_ROOT with it's content
217+
# replace occurences of $APP_ROOT with its content
214218
JVMArguments=`eval "echo ${JVMArguments}"`
215219
fi
216220

0 commit comments

Comments
 (0)