Apple MAC change or switch java version

 
By default JAVA is installed on mac at /System/Library/Java/JavaVirtualMachines
 
 
 
1. export JAVA_HOME and udpate PATH

host:~/Downloads

$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) ; export PATH=$JAVA_HOME/bin:$PATH

 

2. Check Java version from commandline

 

host:~/Downloads

$ java -version

java version "1.7.0_17"

Java(TM) SE Runtime Environment (build 1.7.0_17-b02)

Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

 

 

 

 

Who's new

  • admin

Who's online

There are currently 0 users online.