This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      When starting jenkins slave, used JAVA_HOME is always the java used to start the jenkins slave. In my case, it was C:\Program Files\Java\jre7.
      As it's only a JRE, and not a full JDK, it didn't contain the javac executable.
      As a consequence, I got

      [ERROR] Unable to locate the Javac Compiler in:
      C:\Program Files\Java\jre7\..\lib\tools.jar
      Please ensure you are using JDK 1.4 or above and
      not a JRE (the com.sun.tools.javac.Main class is required).
      In most cases you can change the location of your Java
      installation by setting the JAVA_HOME environment variable.

      in my maven build log.

      Which allowed me to track it to the jenkins-slave.xml file.

      As far as i understand, this file is used to configure how the jenkins slave is started, when run using Windows service.

      So, in that file, there is this entry :

      <!--
      if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
      The following value assumes that you have java in your PATH.
      -->
      <executable>C:\Program Files\Java\jre7\bin\java.exe</executable>

      I had to change it to one full JDK to have Jenkins able to compile.
      Unfortunatly, i'm quite sure Jenkins will only compile using the JDK I choose (<executable>C:\Program Files\Java\jdk1.6.0_24\bin\java.exe</executable>).

            Assignee:
            Kohsuke Kawaguchi
            Reporter:
            Nicolas Delsaux
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: