How do I configure an elastic agent to use Java 7 only

I'm running Bamboo OnDemand and by default, it tries to compile with Java 8. The odd thing is under the agent configuration, capabilities, JDK8 isn't even listed. Just 5, 6 and 7.

Anyway, I've got a plan that checks out the project from Git and tries to build it using gradlew. The compilation files because it's using JDK8. So how do I configure the agent to use specifically JDK7.


3 answers

1 accepted

0 votes
Accepted answer

Thanks Rafael.

I ended up going with a different solution. Since I'm already using EBS to customize my elastic instance, I just added the following lines to the file /mnt/bamboo-ebs/ before making my snapshot.


export JAVA_HOME=/opt/jdk-7
export PATH=$PATH:$JAVA_HOME/bin

This seems to have solved my problem.

0 votes

Hello Michael,

Thank you for your question.

Have you attempted on setting up the path to JDK?


If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

That requires me to change the gradle build file and to hardcode a path to javac. That type of info shouldn't be hardcoded in the build file in my opinion as it makes it harder to build in other environments (i.e. develop machines).

0 votes

Hello Michael,

I haven't tested but you could try and create a plan variable by providing the path to the Java version you want to use and add this variable to your build file.

Please, refer to Bamboo variables documentation for further information.

Otherwise, it would be required to run an elastic agent and downgrade the java version used to run Bamboo, which is not recommended.

Those are the options you have.

Kind regards,
Rafael P. Sperafico
Atlassian Support

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Jan 15, 2019 in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

259 views 4 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you