Last active
December 14, 2015 16:19
-
-
Save warmwaffles/5114575 to your computer and use it in GitHub Desktop.
Need a quick way to switch java versions in Mac? ~> java_use 1.6
This file contains 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
#!/bin/bash | |
/usr/libexec/java_home -V 2>&1 | grep -E "\d.\d.\d_\d\d" | cut -d , -f 1 | colrm 1 4 | grep -v Home |
This file contains 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
#!/bin/bash | |
export JAVA_HOME=$(/usr/libexec/java_home -v $1) | |
java -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have these sitting in my
~/bin
directory.