Overview
To run the pulse™ server you need to be using Java 1.5. This means that by default, all Java builds will also use Java 1.5. So what if your project requires an older JDK, say 1.4 or earlier? This cookbook entry describes how to configure your pulse™ project to use a JDK of your choosing. This is a two part process in which you first configure your pulse™ project to require Java 1.4, and then, if necessary, update your server/agents to handle builds that require Java 1.4.
Configure your server/agents to run builds that require Java 1.4
The following steps show you how to configure the server/agents with the details (such as installation directory) of Java 1.4.
- Click on the "agent" tab, then select the agent that has access to Java 1.4 from the list.
- Now select the agents "Resources" tab. It is likely that pulse has already detected that the Java 1.5 is installed. What we need to do is create a similar resource version, but for 1.4.
- Edit the java resource or create a new resource called java if it does not exist by clicking on "add new resource" and setting the name to java.
- Add a new version, called 1.4, and configure 3 properties:
- java.bin.dir, for example: /usr/local/java/jdk1.5.0_08/bin. Select this property to be added to the path.
- JAVA_HOME, for example: /usr/local/java/jdk1.5.0_08. Select this property to be added to the environment.
- java.bin, for example: /usr/local/java/jdk1.5.0_08/bin/java
- Save and you're done.
Configure your project to require Java 1.4
The following steps guide you through the process of creating a Java 1.4 required resource for your pulse™ project. If your project requires a different version of Java, substitute the "1.4" for your required version.
- Go to the project configuration page by clicking on the "Projects" tab, then selecting your project from the list and then clicking on the "Configuration" tab.
- Click the "edit" link for the build specification you want to update.
- Click the "add required resource" link to bring up the required resource form. Where it asks for the name and version of the resource, enter the name java and the version you require, which is 1.4 for this example. Alternatively, you can select the "browse" link and select the java 1.4 resource that you just configured from the list
- Click Save and you're done.
 |
When selecting a required resource you can use the resource browser to view the list of all configured resources, including those from remote agents! |
What does all this mean?
What you have done here is told pulse that Java 1.4 resource is available on the specified agent, and if a build requires that particular resource, pulse will
- only build on an agent that has the required resource, and
- import that resource into the build context, setting up the PATH and environment as requested.
The result is a build that will always run against your select version of Java. Nice.
Further reading
For more information about resources and how they work in pulse™, good starting points are: