Defining a new JDK capability

A JDK must be installed, and defined in Bamboo as a capability, before Bamboo can make use of it when building jobs.

At least one JDK was automatically defined when you installed Bamboo. You can define additional JDK capabilities that are:

  • for a specific local or remote agent 
  • shared by all local agents
  • shared by all remote agents.

On this page:

Once you have defined a new JDK capability in your Bamboo system, its label (e.g. '1.5') will appear in the Build JDK list when you configure a job's builder (see Configuring tasks). The JDK you select will be used for every one of that job's builds. That is, the job can only be built by agents which have a JDK capability whose label is specified in the job's Build JDK field.

(info) Note that if an agent has its own specific JDK capability, that value will override the value of a shared JDK capability of the same name (if one exists).

Defining a JDK capability on an agent

To define a new agent-specific JDK capability:

  1. Click the  icon and select Overview.
  2. Click Agents in the left panel.
  3. Click the name of the required agent.
  4. Click the Capabilities tab, and then Add capability (to the right of 'Agent-Specific capabilities').
  5. Choose Capability type JDK.
  6. In the JDK label field, type a name/label for the JDK. Bamboo displays this in the Build JDK list whenever a job's builder is configured.
  7. In the Java home field, type the location of the JDK Home Directory.
  8. Click Add.

Defining a local server JDK capability

Local server capabilities are inherited by all local agents.

To define a new local server JDK capability:

  1. Click the  icon in the Bamboo header and choose Overview.
  2. Click Server Capabilities in the left navigation panel.
  3. Choose Capability Type > JDK in the 'Add Capability' section at the end of the page.
  4. In the JDK Label field, type a name/label for the JDK. Bamboo displays this in the Build JDK list whenever a job's builder is configured.
  5. In the Java Home field, type the location of the JDK Home Directory.
  6. Click Add.

Defining a shared remote JDK capability

Shared remote JDK capabilities are not shared with elastic agents.

To define a new shared remote JDK capability:

  1. Click the  icon in the Bamboo header and choose Overview.
  2. Click Agents in the left navigation panel.
  3. In the 'Remote Agents' section, click Shared Remote Capabilities at the right.
  4. Choose Capability Type > JDK in the 'Add Capability' section at the end of the page (see screenshot below).
  5. In the JDK Label field, type a name/label for the JDK. Bamboo Bamboo displays this in the Build JDK list whenever a job's builder is configured.
  6. In the Java Home field, type the location of the JDK Home Directory.
  7. Click Add.

Notes

  • Configuring generic JDK capabilities — If you want to indicate that an agent is capable of running builds for a set of related JDKs (e.g. all point versions of JDK 1.5), you set up generic JDK capabilities to encompass these JDKs.
    For example, you can set up the following JDK capabilities for your Bamboo agent(s):
    • JDK (where 'JDK Label' = 'JDK' and 'Java Home' = '/usr/java/jdk1.5.0_07') — this JDK capability indicates that an agent(s) is capable of running builds with any JDK requirement.
    • JDK 1.5 (where 'JDK Label' = 'JDK 1.5' and 'Java Home' = '/usr/java/jdk1.5.0_07') — this JDK capability indicates that an agent(s) is capable of running builds with a JDK 1.5 requirement or any point version of JDK 1.5, e.g. 1.5.0_07, 1.5.0_08, etc.
    • JDK 1.5.0_07 (where 'JDK Label' = 'JDK 1.5.0_07' and 'Java Home' = '/usr/java/jdk1.5.0_07') — this JDK capability indicates that an agent(s) is only capable of running builds with a JDK 1.5.0_07 requirement.
  • If you wish to find redundant JDK capabilities, you can view the list of JDK capabilities set up in Bamboo and delete any unwanted JDK capabilities.
     
  • Automatically defined capabilities – This depends on the system environment variables (e.g. 'JAVA_HOME=/opt/java/java_sdk1.5') that were present on the machine on which Bamboo was installed:
    • On the Bamboo server, environment variables that were present during installation were saved as shared local capabilities in Bamboo.
    • On remote agents, environment variables that were present during installation were saved as agent-specific capabilities in Bamboo.
Last modified on Jul 17, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.