dbconfession
dbconfession

Reputation: 1199

Can I install multiple JDK's on OSX?

I'm told that for the android app I am trying ot help develop to work, I need to have Java 6, not 7 or 8. Unfortunately I have 7 installed.

I know that on Linux, multiple copies of the JDK can be installed. Is this possible with OSX? Or to at least tell the IDE to use a different JDK?

Upvotes: 0

Views: 375

Answers (2)

Alexandre Santos
Alexandre Santos

Reputation: 8338

Yes, you can install. I have java6, 7, and 8 on my mac.

A note, if you are trying to run it from the command line you can just change the Java home using this:

for Java 6

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

for Java 7

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

for Java 8

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

Once they are installed you can just load them on your IDE by setting up the java home to the version you want.

Upvotes: 1

user692168
user692168

Reputation:

Yes. You can install different JDK versions on the same machine. In Eclipse you can explicitly specify what version of the JDK to use.

However, I would like to point out that Java is backwards-compatible. There's no need for you to downgrade.

Upvotes: 2

Related Questions