Switch between Java 8, Java 7 and Java 6 on OS X

A solution for easily switching the JDK:

List Java Virtual Machines:

/usr/libexec/java_home -V


Switch to Java 6:

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`


Switch to Java 7:
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`


Switch to Java 8:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
or
export JAVA_HOME=/System/Library/Java/Home 

Comments

Popular posts from this blog

How to open the *.war, *.jar files with Midnight Commander (mc)

How to install Oracle 11g XE in MacOS

Running Multiple Versions of Node.js with Node Version Manager

Tips and tricks for ChatGPT

10 Web-Based Tools for Exploring the Capabilities of OpenAI and Machine Learning

VMware Fusion 8 + License Key for MacOSX