javacodex.com
Java Examples
Java Examples
memu home questions

Setting JAVA_HOME environment variable on Mac OS X

List all the JVMs installed on the machine:

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    1.8.0_74, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home
    1.7.0_05, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

Set JAVA_HOME:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

Find the default java_home:

# /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

Questions answered by this page:

How to set JAVA_HOME environment variable on Mac OS X How to set JAVA_HOME on Mac OS X How to list all versions of installed JDK installed on a MAC Finding the default java_home on Mac OS




Contact: javacodex@yahoo.com