Skip to content

Commit

Permalink
[FIXED JENKINS-25601] Amend JAVA_HOME check to work with JDK 9
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Dec 21, 2014
1 parent 7f36c3f commit 1186e7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/JDK.java
Expand Up @@ -182,7 +182,11 @@ public List<JDKInstaller> getDefaultInstallers() {
@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();
Expand Down

0 comments on commit 1186e7b

Please sign in to comment.