Skip to content

Instantly share code, notes, and snippets.

@trajakovic
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trajakovic/4197af9f54e5d223f02b to your computer and use it in GitHub Desktop.
Save trajakovic/4197af9f54e5d223f02b to your computer and use it in GitHub Desktop.
ubuntu / mint - java & javac automatic $JAVA_HOME by update-alternatives
#from http://stackoverflow.com/a/11542973/1137445
Add to ~/.bashrc
JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::")
Install multiple versions of java with update-alternatives. This JAVA_HOME should be up-to-date if current version is switched.
Do not forget to restart terminal ;).
echo "export JAVA_HOME=\$(readlink -f /usr/bin/java | sed \"s:bin/java::\")" >> ~/.bashrc
@trajakovic
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment