File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -514,13 +514,19 @@ def find_java_home
514
514
java_home ||= ENV [ 'JAVA_HOME' ]
515
515
516
516
if java_home
517
+ java_home = File . realpath ( java_home )
517
518
if java_home . include? ( jvmci_version )
519
+ return :use_env_java_home
520
+ end
521
+
522
+ java_version_output = `#{ java_home } /bin/java -version 2>&1`
523
+ if java_version_output . include? ( jvmci_version )
518
524
:use_env_java_home
519
- elsif java_home . include? ( 'jvmci' )
525
+ elsif java_version_output . include? ( 'jvmci' )
520
526
warn "warning: JAVA_HOME=#{ java_home } is not the same JVMCI version as in common.json (#{ jvmci_version } )"
521
527
:use_env_java_home
522
528
else
523
- raise "$JAVA_HOME does not seem to point to a JVMCI-enabled JDK (#{ java_home . inspect } does not contain 'jvmci')"
529
+ raise "$JAVA_HOME does not seem to point to a JVMCI-enabled JDK (` #{ java_home } /bin/java -version` does not contain 'jvmci')"
524
530
end
525
531
else
526
532
raise '$JAVA_HOME should be set in CI' if ci?
You can’t perform that action at this time.
0 commit comments