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

Commit be8a3b2

Browse files
committed
Reorder search for Java VM locations
We currently search for Apple's JVM first, and only if we don't find that go look for the Oracle JVM. While that works, it has a major downside: The Apple JVM is no longer supported by apple, and (on recent versions of OS X) will issue a warning about it being an older version of Java. If we have code that specifies it will work with any version of Java, it is usually best to use the most recent JVM rather than the oldest one. Since Oracle's JVMs are actually maintained these days, defaulting to that seems like a better strategy than defaulting to Apple's JVM.
1 parent e32e2de commit be8a3b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/universalJavaApplicationStub

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,15 @@ elif [ ! -z ${JVMVersion} ] ; then
310310
# first in "/usr/libexec/java_home" symlinks
311311
if [ -x /usr/libexec/java_home ] && /usr/libexec/java_home -F -v ${JVMVersion} > /dev/null ; then
312312
JAVACMD="`/usr/libexec/java_home -F -v ${JVMVersion} 2> /dev/null`/bin/java"
313-
314-
# then in Apple JRE plugin
315-
elif [ -x "${apple_jre_plugin}" ] && JavaVersionSatisfiesRequirement ${apple_jre_version} ${JVMVersion} ; then
316-
JAVACMD="${apple_jre_plugin}"
317-
313+
318314
# then in Oracle JRE plugin
319315
elif [ -x "${oracle_jre_plugin}" ] && JavaVersionSatisfiesRequirement ${oracle_jre_version} ${JVMVersion} ; then
320316
JAVACMD="${oracle_jre_plugin}"
321-
317+
318+
# then in Apple JRE plugin
319+
elif [ -x "${apple_jre_plugin}" ] && JavaVersionSatisfiesRequirement ${apple_jre_version} ${JVMVersion} ; then
320+
JAVACMD="${apple_jre_plugin}"
321+
322322
else
323323
# display error message with applescript
324324
osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'\n\nNo suitable Java version found on your system!\nThis program requires Java ${JVMVersion}\nMake sure you install the required Java version.\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)"

0 commit comments

Comments
 (0)