Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run a TeamCity (default) build agent with 32-bit java on ubuntu 64-bit, I have created a [TeamCity]/bin/ what contains:


That works fine running the server with 32-bit jre, but not for the agent: I've tried these lines in [buildAgent]/conf/


and also a '[buildAgent]/jre' link

[buildAgent]/jre -> /usr/lib/jvm/ia32-java-6-sun/jre/

when I do a '[TeamCity]/bin/ start' I get this:

Using CATALINA_BASE:   /srv/TeamCity
Using CATALINA_HOME:   /srv/TeamCity
Using CATALINA_TMPDIR: /srv/TeamCity/temp
Using JRE_HOME:        /usr/lib/jvm/ia32-java-6-sun
Using CLASSPATH:       /srv/TeamCity/bin/bootstrap.jar:/srv/TeamCity/bin/tomcat-juli.jar
Starting TeamCity build agent...
Java executable is found in '/usr/bin/..'.
Starting TeamCity Build Agent Launcher...
Agent home directory is /srv/TeamCity/buildAgent
Current Java runtime version is 1.6
Lock file: /srv/TeamCity/buildAgent/logs/
Using no lock
Done [16436], see log at ../logs/teamcity-agent.log

As you can see from the output, the server is using 32-bit jdk, but the build agent is running the java found in '/usr/bin' (which is 64-bit in my case).

Closer inspection of the '[buildAgent]/bin/', it looks like the script runs a 'which java' and finds the default system java before it even tries any of the supplied args/folders. I think it should find '[buildAgent]/jre' before the system java.

Whats the correct way to specify the java version to use for a build agent, which may be a different version than the server?

Should I just modify to check its arguments before checking the system path for java?

share|improve this question

You need to set JDK version of the buildAgent in the settings page of the project.

The JRE versions you specified are for Teamcity server. If you go to Edit Configuration Settings page of the project, there's Build Step link. In the Build Step page, you can specify JDK and JDK home path.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.