Skip to content

Instantly share code, notes, and snippets.

@Geolykt
Created October 30, 2021 12:14
Show Gist options
  • Save Geolykt/0bee6c48b6bf0015302c47b1ea4da84f to your computer and use it in GitHub Desktop.
Save Geolykt/0bee6c48b6bf0015302c47b1ea4da84f to your computer and use it in GitHub Desktop.
Set the Java Home based on the java defined by alternatives. Not the most efficent approach, but works on my machine (TM)
export JAVA_HOME=`alternatives --display java | grep "link currently points to" | tr ' ' '\n' | grep -o -P "[\\/].+" | sed -e "s/bin\/java//"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment