Milos Zikic - Personal site, sharing thoughts about startups, products and engineering

JDK 1.7 on Mac OS X and in various IDEs

Hey JDK 1.7 is out for a while and here is how to use it in your favorite IDE.

But first you need to download JDK 1.7 OS X Preview. Follow the installation instructions and your JDD 1.7 installation should finish up in

/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/


Eclipse

  • Edit your eclipse.ini
    vim /Applications/Eclipse.app/Contents/MacOS/eclipse.ini

  • Add before first line:
    - vm
    /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/bin/java

NetBeans

  • Edit your netbeans.conf
    • "vim /Applications/NetBeans/NetBeans\ 7.1.app/Contents/Resources/NetBeans/etc/netbeans.conf"
  • Change netbeans_jdkhome to
    netbeans_jdkhome="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home"

6/15/2012 - Update:
This worked before official 11 release. Idea changed how they handle JDKs and they are depending on Apples JDK to run.
You can use Oracles JDK 1.7 for running any projects in IDEA however, but you cannot run IDEA itself. 

IntelliJ IDEA

  • Edit your Info.plist
    vim /Applications/IntelliJ\ IDEA\ 11.app/bin/idea.sh

  • Add to the top:
    IDEA_JDK=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

  • Save and run IDEA by
    cd /Applications/IntelliJ\ IDEA\ 11.app/
    ./bin/idea.sh


Comments

Miloš Žikić
This worked before official 11 release. Idea changed how they handle JDKs and they are depending on Apples JDK to run.

You can use Oracles JDK 1.7 for running any projects in IDEA however, but you cannot run IDEA itself.
Archimedes Trajano
How would you do the change on IntelliJ IDEA 11 CE?

I don't have a bin/idea.sh file in there

Share this post