Created
October 20, 2014 23:20
-
-
Save maciej/3405588c411aafcf71b2 to your computer and use it in GitHub Desktop.
Utility to quickly change the JAVA_HOME in OSX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function jh | |
| if test -e /usr/libexec/java_home | |
| set _jh (/usr/libexec/java_home -v 1.$argv) | |
| if test -n $_jh | |
| echo "Setting JAVA_HOME to $_jh" | |
| set -gx JAVA_HOME $_jh | |
| else | |
| echo "Could not find java version $argv" | |
| end | |
| else | |
| echo "java_home helper not found!" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment