Running J6 and J7 on the same box?

ImAMacGuy
Valued Contributor II

Is there any ramifications to Running J6 and J7 on the same box? Will the apps know which to use? Should I even bother with J7?

8 REPLIES 8

sgrall-pfg
Contributor

I haven't had any issues running both.

In order to completely update an existing Java 6 install to 7, you will need to install the Java 7 JDK, rather than the JRE. Java 6 on the Mac is actually the Java 6 JDK.

Many apps that refuse to work with the Java 7 JRE will work with Java 7 JDK. Some apps (like the Casper Suite/JSS) still seem to require Java 6 regardless.

jarednichols
Honored Contributor

Yes, you can run them both. It really depends on what your needs are.

JPDyson
Valued Contributor

For our builds, I believe we have to at this point; one piece of crap utility that demands Java 1.6 be present. No conflicts, best I can tell.

CasperSally
Valued Contributor II

Are there any gotchas that you have to install one before the other?

On next year's image, I'm thinking of installing Java 7, not aware of any apps requiring 6. Just don't want to regret it if there's some gotcha if you need 6 it has to be installed before 7.

ImAMacGuy
Valued Contributor II

@sgrall -- I cuoldn't find a JDK for J7... do you have a link handy?

mm2270
Legendary Contributor III

Here: http://www.oracle.com/technetwork/java/javase/downloads/index.html

The Oracle Java 7 JDK and JRE downloads are right next to each other on that page.

sgrall-pfg
Contributor

I just discovered a caveat with Java 7 JDK--- the old JVMs are not automatically removed from /Library/Java/JavaVirtualMachines when you upgrade. I'm trying to find a way to script the removal of all but the newest as part of a policy. If any master scripters out there know of a way to remove all but the newest file in a folder, I'd appreciate the assistance!

@CasperSally--You can install Java 6 after installing Java 7 if necessary. Worked fine for me.

sgrall-pfg
Contributor

Ok, this works to remove all but the newest Java 7 JVM:

ls -rd /Library/Java/JavaVirtualMachines/* | sed 1d | sudo xargs rm -R

It relies on the assumption that all JVM files will be named in such a way that the newest will be listed first when ls is applied in reverse order, which looks to be the case going forward...