Skip to content

Instantly share code, notes, and snippets.

@ryanpadilha
Last active December 15, 2015 03:50
Show Gist options
  • Save ryanpadilha/d6d3ca101aebbb5fbb00 to your computer and use it in GitHub Desktop.
Save ryanpadilha/d6d3ca101aebbb5fbb00 to your computer and use it in GitHub Desktop.
$JAVA_HOME on Mac OS X
$ vim .profile
export JAVA_HOME=$(/usr/libexec/java_home)
$source .profile
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.0_65, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
1.7.0_21, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
$ java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment