How to select specific jdk installation for build agent?

I have both java 6 and java 7 installed on my machine.
The TeamCity build agent seems to pick java 7 to run the build against.
However, I want it to use the java 6 installation.
How do i configure it to do that?

3 comments
Comment actions Permalink

I think you can try to override the env.JAVA_HOME variable for the specific agent in <agent directory>/conf/buildAgent.properties file (bottom)

ziv shapira

0
Comment actions Permalink

I dont see a env.JAVA_HOME in buildagent.properties, but i do see a env.TEAMCITY_JRE.
Are the two different? If so how?

Also the launcher/cong/wrapper.conf also has a wrapper.java.command property. Where is that used?

There are too many locations pointing to a jre. Which one is used during the actual build?

0
Comment actions Permalink

JAVA is the JDK and JRE is only the run time. you can add variables that are not there, and try which works for you (of course backup the properties file before you change it)
what is used in the build can clearly be seen in the build, go to the "build parameters" tab (next to build log tab) and you will see the values for all parameters, and then you will know which one to override.

0

Please sign in to leave a comment.