18

I need to test a web application with JRE 6. I am using a Mac with OS X 10.10 and Java 7 for development. How can I install JRE 6 next to Java 7 on this Mac?

This previous answer does not yet account for the fact (also mentioned in a comment) that Apple's download link by now points to a .pkg (Java for OS X 2014-001) file. Without further knowledge I hasten to install it, for it may overwrite my current Java 7 setup (and may no longer contain JRE 6 in the first place).

2

2 Answers 2

10

JavaForOSX2014-001.dmg contains Java for Mac OS X (1.6.0_65-b14-462). It will be installed to /System/Library/Java and /System/Library/Frameworks while Oracle Java is located at /Library/Java. No file will be overwritten.
To avoid any trouble (especially with your $JAVA_HOME/$PATH) consider setting up a Mac OS X VM in VMWare, Parallels or VirtualBox with JRE6 only.

8

As noted by @klanomath "No file will be overwritten": You can have multiple JDK's installed but only one JRE. But each JDK also comes with a JRE.

Apple's Java integration with OS X provides /usr/libexec/java_home that can help you keep the JDK situation straight. That selects among the JDK's and their associated JRE found in /Library/Java/JavaVirtualMachines. See the man java_home page.

However there is no equivalent capability to select among versions of the JRE accessed via /Library/Internet Plug-ins/ http://support.apple.com/en-us/HT202643 provides the only 'official' way to select among those, which requires terminal savvy with sudo and symbolic links. Since you are a developer testing web apps one assumes that will suffice, but not something mere mortals want to mess around with.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .