Skip to main content
All CollectionsKnowledge BaseBitrise infrastructure
JAVA HOME isn't set correctly after switching to Java 11 on macOS-based stacks
JAVA HOME isn't set correctly after switching to Java 11 on macOS-based stacks
Updated over 4 months ago

Issue:

After using the script to switch to Java 11 on macOS-based stacks, JAVA_HOME is set incorrectly and Steps using this Environment Variable may fail.

Possible solutions:

If you are using the below script to switch to Java 11:

jenv global system 
export JAVA_HOME="$(jenv prefix)"
envman add --key JAVA_HOME --value "$(jenv prefix)"

Change the first line so that the script contains:

jenv global 11
export JAVA_HOME="$(jenv prefix)"
envman add --key JAVA_HOME --value "$(jenv prefix)"
Did this answer your question?