Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Michael Pridemore April 26, 2015

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.

Thanks.

3 answers

1 accepted

0 votes
Answer accepted
Michael Pridemore April 28, 2015

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/profile-extras.sh 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
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2015

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

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 27, 2015

Hello Michael,

Thank you for your question.

Have you attempted on setting up the path to JDK?

compile.options.fork=true;
compile.options.forkOptions.executable='path/to/javac'

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

Michael Pridemore April 27, 2015

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).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events