Skip to content

Commit

Permalink
feat: Support Oracle JRE for Java 10
Browse files Browse the repository at this point in the history
The JRE for Java 10 appears to be the last Oracle provided JRE.
  • Loading branch information
rhwood committed Oct 27, 2019
1 parent 5e468fe commit f8a22be
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/AppScriptTemplate
Expand Up @@ -298,19 +298,21 @@ if [ -z "${JAVA_HOME}" ] ; then
# Otherwise, use java_home if it's present
# Otherwise, prompt the user to install Java
#
# Default JRE location
# Oracle JRE location; note that Oracle only shipped JREs for Java 8, 9, and 10
# and now only ships the JRE for Java 8.
JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
if [ -x "${JAVA_HOME}/bin/java" ] ; then
JAVACMD="${JAVA_HOME}/bin/java"
# Test if java is present and version 1.8 or 9
# Test if java is present and version 1.8, 9, or 10
java_version="$( "${JAVACMD}" -version 2>&1 | grep version )"
if [[ ! "${java_version}" =~ \"1.8 && ! "${java_version}" =~ \"9 ]] ; then
if [[ ! "${java_version}" =~ \"1.8|\"9|\"10 ]] ; then
JAVA_HOME=""
fi
else
# Reset JAVA_HOME since there is no java executable in it
JAVA_HOME=""
fi
# Find an installed JRE/JDK location
if [[ -z "${JAVA_HOME}" && -x /usr/libexec/java_home ]] ; then
# Test for any JDKs of version 1.8 or newer
JAVA_HOME=$( /usr/libexec/java_home --version 1.8+ --failfast 2>/dev/null )
Expand Down

0 comments on commit f8a22be

Please sign in to comment.