JDK 1.4.2 build problems [build 1574]

Hi,

TeamCity server and agents require JDK 1.5. My builds require JDK 1.4.2. The builds are currently setup to execute shell scripts on a Linux box. I wrote an ant wrapper build xml to run exec tasks to run the shell scripts. To enable the scripts to work properly, I had to set the default JAVA_HOME value to 1.4.2. Both agent and server are running on the same Linux box. To enable TC to start with runAll.sh, I added the following to the top of TeamCity/bin/catalina.sh & TeamCity/buildAgent/bin/catalina.sh:
JAVA_HOME=/usr/java/jdk1.5.0_08

The result is that the shell scripts that run the builds end up with JAVA_HOME being set to JDK 1.5. Since JAVA_HOME is not being exported, this doesn't seem right. BTW, setting the "JDK home path" value to JDK 1.4.2 in the build configuration through the UI has no effect. Also, setting nested env keys within the exec tasks that are running the shell scripts did not work. Am I missing something?

3 comments
Comment actions Permalink

The way I do agent builds with 1.4.2 is the following:

- Add a line in $BUILD_AGENT/bin/buildAgent.properties:

system.JAVA_HOME_14=/usr/java/j2sdk1.4.2_12
- Run the buildAgent with:

JAVA_HOME=/usr/java/jdk1.5.0_08
- For the build configuration of an app that I want to build against 1.4, set the "JDK Home Path" entry on the main page of the configuration to:

%system.JAVA_HOME_14%

So the agent itself will run with 1.5, but the build will run with Java 1.4. This also allows me to have build agents with different locations of the 1.4 JDK.

Hope that helps.

--Tim

0
Comment actions Permalink

Hi Tim,

Thanks for the advice. I just installed TC build 1611 and will try what you suggested. Just wondering if you know whether builds run with shell scripts will pick up the $JAVA_HOME_14 variable if it is set in the TC build configuration. If not, I suppose I could set $JAVA_HOME to $JAVA_HOME_14 inside each shell script...as tedious as that will be.

-Dave

0
Comment actions Permalink

Not sure what you mean by "run with shell scripts".

And I'm not familiar with the inner workings of how "JDK Home Path" from the config page gets used. I'd think it is a special value that the build agent looks for in order to choose how to start up the ant script. I do see -DJAVA_HOME_14=blahblahblah in the ps of the running build, but that makes sense since it is defined in the buildAgent.properties.

--Tim

0

Please sign in to leave a comment.