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

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

Avatar

1 badge earned

Collect

Participate in fun challenges

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

Challenges
Coins

Gift kudos to your peers

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

Recognition
Ribbon

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!

Leaderboard

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
4,459,382
Community Members
 
Community Events
176
Community Groups

JAVA_HOME set to /usr/lib/jvm/default-java

Edited

I've just spun up bamboo on an Ubuntu VM & I'm taking my first steps with the product.

I'm trying to run a simple script which prints groovy --version and / or echo $JAVA_HOME

The echo statement is empty and groovy --version results in:

groovy: JAVA_HOME is not defined correctly, can not execute: /usr/lib/jvm/default-java/bin/java

When I  run ${bamboo_capability_system_jdk_JDK}/java -version it works.

When I run echo $JAVA_HOME on an SSH connection, I get /usr/lib/jvm/java-8-openjdk-amd64/`. java --version also works in a terminal.

My /etc/environment file looks like this.

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-openjdk-amd64/"
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"

I also have a global JDK set and can see that in the plan execution log:

bamboo_capability_system_jdk_JDK=/usr/lib/jvm/java-8-openjdk-amd64/

Why is Bamboo unable to see the JAVA_HOME setting?

1 answer

0 votes

Hi,

I assume you are using the script task in Bamboo for your script: Bamboo Script task

It is possible to add environment variables in this script task but I do recommend that you use Bamboo capabilities and executables and Bamboo variables when you are defining your tasks. I will make sense to you very quickly. It is very flexible and dynamic.

Hope this will help you get further.

Regards

Lasse Langhorn

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events