简体   繁体   中英

Using Multiple JDKs on OSX Mavericks

On platforms like Windows and Linux installation of additional JDKs for development purposes is fairly trivial: download a compressed file, uncompress it in some out-of-the-way directory, point JAVA_HOME at that location, and invoke the files in its bin directory.

I'm trying to do the logical equivalent for OS X and am seeking the advice of Java gurus who might have a preferred way to do this on that doesn't tamper with the actual OS X environment. My end objective is to merely have several JDKs, historic and experimental, to choose from when using IntelliJ.

To be clear, I'm not trying to update the Java used by OS X, nor change the JRE that gets invoked by the browser. Each JDK that I've grabbed from the vendor seems to want to replace the OS's version, which is the exact opposite of what I'd like.

From past experience, OS X (while Unix under the hood) is actually a collection of cooperating applications that have been carefully selected for dependencies and version feature compatibility; upgrading a language or service can often have disastrous or unexpected consequences, thus sandboxing alternate versions seems the better approach, plus it makes projects immune from OS upgrades.

Any recommendations?

If you become a registered Apple Developer you will have access download different versions of the Java for OS X Developer Package which, I believe, can be installed concurrently.

Please note, you DO NOT have to join the Mac Developer Program (which costs $99). You only need to register as a developer, which is free.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM