I can see the JDK reference in the new installation config.xml file:

  <jdks>
    <jdk>
      <name>jdk1.7.0_45</name>
      <home>D:\Tools\Java\jdk1.7.0_45</home>
      <properties/>
    </jdk>
  </jdks>

The way I resolved this was to go into the startup file and change the 
following code:

  <env name="JENKINS_HOME" value="%BASE%"/>
  <!--
    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>%JAVA_HOME%\jre\bin\java</executable>
  <arguments>-Xrs -Xmx1024m 
-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar 
"%BASE%\jenkins.war" --httpPort=8081</arguments>

I changed the executable form %BASE% to JAVA_HOME, but it seems like I should 
not have to do that, that jenkins would pick up and use the configured JDK in 
the config file and not the version used to run the service.  Does this seem 
right?

Thanks, Eric
 
On Tuesday, May 13, 2014 10:52 AM, Eric Wood <eric.w...@rocketmail.com> wrote:
 
I have a new installation of Jenkins LTS running on a windows server.  I have 
both the system property JAVA_HOME set to an installation of a 1.7 JDK and the 
jenkins' JAVA_HOME configuration to the same installation.  When I run a maven 
build. the compile fails and seems to want to point to the JRE that was 
installed with the new jenkins LTS native package.

How do I get the javac to point to my JDK version?

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) 
on project ctmsstudyintegrate: Compilation failure [ERROR] Unable to locate the 
Javac Compiler in: [ERROR] D:\Tools\Jenkins-1.532.2-LTS\jre\..\lib\tools.jar 
[ERROR] Please ensure you are using JDK 1.4 or above and [ERROR] not a JRE (the 
com.sun.tools.javac.Main class is required). [ERROR] In most cases you can 
change the location of your Java [ERROR] installation by setting the JAVA_HOME 
environment variable.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to