diff --git a/changelog.html b/changelog.html
index 8799b040dbbbcfff1d675daf129947e5703bc5e4..a428ba597da0a00494cc1fa54eae52ffee21bbbf 100644
--- a/changelog.html
+++ b/changelog.html
@@ -45,6 +45,9 @@ Upcoming changes
Fixed an AbstractMethodError in listing up executors.
(issue 8106)
+
+ Slaves launched by JNLP fail to reprot their version numbers.
+ (issue 8060)
diff --git a/remoting/src/main/java/hudson/remoting/Launcher.java b/remoting/src/main/java/hudson/remoting/Launcher.java
index 57658594c53a7fdc075bc6b585be2b0c6e3874c3..9cddcdc336129f42045b1df60e1ef17c1184e3dc 100644
--- a/remoting/src/main/java/hudson/remoting/Launcher.java
+++ b/remoting/src/main/java/hudson/remoting/Launcher.java
@@ -159,7 +159,6 @@ public class Launcher {
}
public static void main(String... args) throws Exception {
- computeVersion();
Launcher launcher = new Launcher();
CmdLineParser parser = new CmdLineParser(launcher);
try {
@@ -439,7 +438,7 @@ public class Launcher {
return File.pathSeparatorChar==';';
}
- private static void computeVersion() {
+ private static String computeVersion() {
Properties props = new Properties();
try {
InputStream is = Launcher.class.getResourceAsStream("hudson-version.properties");
@@ -448,11 +447,11 @@ public class Launcher {
} catch (IOException e) {
e.printStackTrace();
}
- VERSION = props.getProperty("version", "?");
+ return props.getProperty("version", "?");
}
/**
* Version number of Hudson this slave.jar is from.
*/
- public static String VERSION = "?";
+ public static final String VERSION = computeVersion();
}
diff --git a/remoting/src/main/java/hudson/remoting/jnlp/Main.java b/remoting/src/main/java/hudson/remoting/jnlp/Main.java
index b80638f8e00b77b477608fbe050110d50c3868c1..18cc59f62cebc342a756142329d83fd772e2a746 100644
--- a/remoting/src/main/java/hudson/remoting/jnlp/Main.java
+++ b/remoting/src/main/java/hudson/remoting/jnlp/Main.java
@@ -23,6 +23,7 @@
*/
package hudson.remoting.jnlp;
+import hudson.remoting.Launcher;
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Argument;