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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How i can set Java version for agent if Default job - shell script.

Hello! I use shell script for running sbt task on different environments but by default Bamboo agent uses Java8 instead Java11. How i should setUp JAVA_HOME variable or may be i have other way if we have both Java versions on Bamboo? 

1 answer

Simon says:

` Please use the Command task instead of the Script task because it allows you to set the environment for the command you are executing as well as choose the command. See the details here:

Obviously if you have more things being called in your current Script task like:


<some native bash statements>
<the sbt call that needs Java 11>
<some more native bash statements>

then you can structure your Job tasks as follows:

1. Script task 1 containing the first bash statements,

2. Command task to call the sbt task with Java 11(set the Executable parameter to the absolute path of your Java 11 java binary, the Argument parameter to what you want the JVM to run,and the Environment variables to the ones you need)

3. Script task 2 containing the rest of the bash statements in the example above.


I hope this helps. Simon out.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events