Skip to content
Permalink
Browse files

[FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9

(cherry picked from commit 1186e7b)
  • Loading branch information...
daniel-beck authored and olivergondza committed Dec 21, 2014
1 parent b7ccd6b commit bf6859f059bc809a8b1bae6ef184af56a37f79e0
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/src/main/java/hudson/model/JDK.java
@@ -182,7 +182,11 @@ public String getDisplayName() {
@Override protected FormValidation checkHomeDirectory(File value) {
File toolsJar = new File(value,"lib/tools.jar");
File mac = new File(value,"lib/dt.jar");
if(!toolsJar.exists() && !mac.exists())

// JENKINS-25601: JDK 9+ no longer has tools.jar. Keep the existing dt.jar/tools.jar checks to be safe.
File javac = new File(value, "bin/javac");
File javacExe = new File(value, "bin/javac.exe");
if(!toolsJar.exists() && !mac.exists() && !javac.exists() && !javacExe.exists())
return FormValidation.error(Messages.Hudson_NotJDKDir(value));

return FormValidation.ok();

0 comments on commit bf6859f

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.