diff options
author | Jakob Odersky <jakob@odersky.com> | 2016-12-12 14:57:43 -0800 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2016-12-12 14:57:43 -0800 |
commit | 0ad20c04752dcf9b5d50b639201c2c71af22bd4b (patch) | |
tree | 135654324592b873380cd4b8d87ae36d2a0c1681 /src/compiler/scala/tools/ant/templates/tool-unix.tmpl | |
parent | 7ae0aec7a202b22ea427d504ad3a79c0998e4b8f (diff) | |
download | scala-0ad20c04752dcf9b5d50b639201c2c71af22bd4b.tar.gz scala-0ad20c04752dcf9b5d50b639201c2c71af22bd4b.tar.bz2 scala-0ad20c04752dcf9b5d50b639201c2c71af22bd4b.zip |
Unix script template: get java version through java commandscript-linux
Diffstat (limited to 'src/compiler/scala/tools/ant/templates/tool-unix.tmpl')
-rwxr-xr-x | src/compiler/scala/tools/ant/templates/tool-unix.tmpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl index b5a238f7be..f35dbd86ed 100755 --- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl @@ -198,8 +198,8 @@ fi if [[ "$usebootcp" == "true" ]]; then classpath_args=("-Xbootclasspath/a:$TOOL_CLASSPATH" -classpath "\"\"") # Note that the version numbers go 1.7, 1.8, 9, 10, ... - java_release="$(cat $JAVA_HOME/release | grep JAVA_VERSION)" - if [[ ! "$java_release" =~ JAVA_VERSION=\"1\. ]]; then + java_release="$($JAVACMD -version 2>&1 | head -n 1 | sed 's/.* version \"\(.*\)\"/\1/g')" + if [[ ! "$java_release" =~ 1\. ]]; then # Java 9 removed sun.boot.class.path, and the supposed replacement to at least see # the appended boot classpath (jdk.boot.class.path.append) is not visible. # So we have to pass a custom system property that PathResolver will find. |