Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I fix my Java for Mac installation after installing the Atlassian SDK?

Jim Constant
Contributor
September 3, 2019

I followed the instructions here: https://confluence.atlassian.com/adminjiraserver073/installing-java-861253016.html but I get the following error when I run 'atlas-version':

ATLAS Version: 8.0.16
ATLAS Home: /Applications/Atlassian/atlassian-plugin-sdk-8.0.16
ATLAS Scripts: /Applications/Atlassian/atlassian-plugin-sdk-8.0.16/bin
ATLAS Maven Home: /Applications/Atlassian/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4
AMPS Version: 8.0.2
--------
Executing: /Applications/Atlassian/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/bin/mvn --version -gs /Applications/Atlassian/atlassian-plugin-sdk-8.0.16/apache-maven-3.5.4/conf/settings.xml
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

I then followed Oracle's instructions for uninstalling the JRE and I get the same error.

This is how I'm setting my env in my shell config"

# env
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.0_91.jdk
export JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin

Not sure what else to try at this point. 

Any suggestions?

Thanks

1 answer

1 accepted

2 votes
Answer accepted
DPKJ
Community Champion
September 3, 2019

After installing JDK (and not JRE), try adding this,

export JAVA_HOME=`/usr/libexec/java_home`

in your /Users/<your_name>/.bash_profile file (create it if it doesn't exists)

Once this is done, either close terminal and open it again, or you can use `source` command.

 source ~/.bash_profile

 Also after this test if JAVA_HOME is set,

echo $JAVA_HOME

This should print out location of your Java home folder.

Jim Constant
Contributor
September 4, 2019

Thank you, DPK. Using

export JAVA_HOME=`/usr/libexec/java_home`

worked.

I'm using Z shell so I edited my ~/.zshrc file, but of course it works the same way.

DPKJ
Community Champion
September 4, 2019

@Jim Constant  Although, I myself use FISH shell, but it is convention to answer shell related questions in BASH as this is default in almost all Linux distribution.

Z Shell is also wonderful, I have used it for long time (~2 Years).

Upcoming Macos (Catalina) version will default to Z Shell.

Suggest an answer

Log in or Sign up to answer