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

Commit 10af1b7

Browse files
committed
check Info.plist for Apple style Java keys
if key :Java is present, parse in apple mode That’s a better indicator than the location of the Java lib folder in the app package
1 parent c7c29b6 commit 10af1b7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/universalJavaApplicationStub

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ CFBundleName=`/usr/libexec/PlistBuddy -c "print :CFBundleName" "${InfoPlistFile}
111111
CFBundleIconFile=`/usr/libexec/PlistBuddy -c "print :CFBundleIconFile" "${InfoPlistFile}"`
112112

113113

114-
# read Info.plist in Apple style
115-
if [ -d "${AppleJavaFolder}" ]; then
114+
# check Info.plist for Apple style Java keys -> if key :Java is present, parse in apple mode
115+
/usr/libexec/PlistBuddy -c "print :Java" > /dev/null 2>&1
116+
exitcode=$?
117+
118+
# read Info.plist in Apple style if exit code returns 0 (true, :Java key is present)
119+
if [ $exitcode -eq 0 ]; then
116120

117121
# read the Java WorkingDirectory
118122
JVMWorkDir=`/usr/libexec/PlistBuddy -c "print :Java:WorkingDirectory" "${InfoPlistFile}" 2> /dev/null | xargs`
@@ -153,7 +157,7 @@ if [ -d "${AppleJavaFolder}" ]; then
153157

154158

155159
# read Info.plist in Oracle style
156-
elif [ -d "${OracleJavaFolder}" ]; then
160+
else
157161

158162
# set Working Directory and Java and Resources folder
159163
JavaFolder="${OracleJavaFolder}"

0 commit comments

Comments
 (0)