0

I'm a longtime Java developer switching from Ubuntu to Mac: On my Linux development environment, I would untar different jdks to ~/opt/jdk and then setup a current soft link like this:

~/opt/jdk/jdk_1.7.0_51
~/opt/jdk/jdk_1.8.0_05
~/opt/jdk/current -> jdk_1.8.0_05

In ~/bin, I had a java soft link that would point to ~/opt/jdk/current/bin/java

If I wanted to switch JDKs for development, I would just switch the current link.

On Mac, I can only download .dmg files that contain installers. If I run more than one, it seems like the latter overwrites the existing install? Can't I simply download binary archives like on Linux?

clay
  • 18,138
  • 28
  • 107
  • 192
  • 1
    I don't think it overrides, just changes what `java` points to. – Rogue May 20 '14 at 03:10
  • 1
    Can you adopt [this scheme](http://stackoverflow.com/q/6588390/230513)? – trashgod May 20 '14 at 03:18
  • Do you need the setting to affect GUI apps that are launched from the Finder, or just stuff that you can run from a terminal session? And do you need to switch between minor versions, like 1.7.0_51 and 1.7.0_55, or just the major 1.7 vs 1.8 versions? – Andrew Janke May 20 '14 at 03:49
  • And which version of OS X are you on? Java support has changed significantly over the major OS revisions. – Andrew Janke May 20 '14 at 03:53
  • Also check out this one which has more details on how multiple installed JDKs work: http://stackoverflow.com/questions/17885494/how-can-i-change-mac-oss-default-java-vm-returned-from-usr-libexec-java-home – Andrew Janke May 20 '14 at 04:33
  • I am on OS X 10.9.3. Thanks for the tips! – clay May 20 '14 at 17:42

0 Answers0