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

Commit 3f79316

Browse files
Adding the possibility to define a JVMClasspath other than 'OracleJavaFolder' ( when building Oracle-style apps )
- if no <key>JVMClasspath</key> is set , fallback to default OracleJavaFolder - this is useful when builds apps that provide a .sh, .bat and .app, and we want to centralize the classpath under a specific folder/path
1 parent a8b1a6d commit 3f79316

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/universalJavaApplicationStub

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,16 @@ else
203203
# replace occurances of $APP_ROOT with it's content
204204
JVMOptions=`eval "echo ${JVMOptions}"`
205205

206-
JVMClassPath="${JavaFolder}/*"
206+
# read the ClassPath in either Array or String style
207+
JVMClassPath_RAW=`/usr/libexec/PlistBuddy -c "print JVMClassPath" "${InfoPlistFile}" 2> /dev/null`
208+
if [[ $JVMClassPath_RAW == *Array* ]] ; then
209+
JVMClassPath=.`/usr/libexec/PlistBuddy -c "print JVMClassPath" "${InfoPlistFile}" 2> /dev/null | grep " " | sed 's/^ */:/g' | tr -d '\n' | xargs`
210+
elif [[ ! -z ${JVMClassPath_RAW} ]] ; then
211+
JVMClassPath=${JVMClassPath_RAW}
212+
else
213+
#default: fallback to OracleJavaFolder
214+
JVMClassPath="${JavaFolder}/*"
215+
fi
207216

208217
# read the JVM Default Options
209218
JVMDefaultOptions=`/usr/libexec/PlistBuddy -c "print :JVMDefaultOptions" "${InfoPlistFile}" 2> /dev/null | grep -o "\-.*" | tr -d '\n' | xargs`

0 commit comments

Comments
 (0)