Skip to content

Commit

Permalink
[FIXED JENKINS-14667] JDK installation failed on some slaves with Inv…
Browse files Browse the repository at this point in the history
…alidClassException: hudson.tools.JDKInstaller$Platform$1; local class incompatible: …
  • Loading branch information
jglick committed Sep 14, 2012
1 parent 8b8e751 commit 8a1b069
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
JDK installation failed on some slaves with <code>InvalidClassException: hudson.tools.JDKInstaller$Platform$1; local class incompatible: …</code>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14667">issue 14667</a>)
<li class=rfe>
Provide symlink support on all possible platforms when using Java 7+, including newer versions of Windows.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13202">issue 13202</a>)
Expand Down
14 changes: 9 additions & 5 deletions core/src/main/java/hudson/tools/JDKInstaller.java
Expand Up @@ -490,11 +490,7 @@ public boolean is(String line) {
* Determines the platform of the given node.
*/
public static Platform of(Node n) throws IOException,InterruptedException,DetectionFailedException {
return n.getChannel().call(new Callable<Platform,DetectionFailedException>() {
public Platform call() throws DetectionFailedException {
return current();
}
});
return n.getChannel().call(new GetCurrentPlatform());
}

public static Platform current() throws DetectionFailedException {
Expand All @@ -504,6 +500,14 @@ public static Platform current() throws DetectionFailedException {
if(arch.contains("sun") || arch.contains("solaris")) return SOLARIS;
throw new DetectionFailedException("Unknown CPU name: "+arch);
}

static class GetCurrentPlatform implements Callable<Platform,DetectionFailedException> {
private static final long serialVersionUID = 1L;
public Platform call() throws DetectionFailedException {
return current();
}
}

}

/**
Expand Down

0 comments on commit 8a1b069

Please sign in to comment.