How to use IntelliJ IDEA with OpenJDK7 on Mac?

I'm using Mac OS X Lion.

Installed OpenJDK 7 from
http://code.google.com/p/openjdk-osx-build/downloads/list?q=label:Featured

"java -version" result is,

openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)



then when click IntelliJ IDEA 10.5 icon, error dialog pops up.

"Cannot launch 'IntelliJ IDEA', No compatible version of java 1.6 is available"

So I reenabled Java 1.6 with OpenJDK 7 enabled too.

then IDEA runs, but 1.7 target project does not compile.


How can I use OpenJDK7 for IDEA?
3 comments
Comment actions Permalink

Hello!
Open File | Project Structure | Platform Settings | SDK, add there new JSDK and provide path to you OpenJDK7. Then open in same dialog Project Settings | Project and check project sdk is the new configured jdk, and project language level  is 7.0. This configuration should help you.

0
Comment actions Permalink

Thank you. It works. :)

0
Comment actions Permalink

If you have only one version of the SDK this solution seems impossible. And after the last patch from Apple for OS X 10.8 this problem will became a real issue.

0

Please sign in to leave a comment.