How to use IntelliJ IDEA with OpenJDK7 on Mac?

I'm using Mac OS X Lion.

Installed OpenJDK 7 from

"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?
Comment actions Permalink

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.

Comment actions Permalink

Thank you. It works. :)

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.


Please sign in to leave a comment.