What’s the accepted procedure and paths to configure jdk and global library source code for Intellij IDEA on OS X?
Answer
As of the latest releases:
- Java for Mac OS X 10.6 Update 3
- Java for Mac OS X 10.5 Update 8
Apple has moved things around a bit.
To quote the Apple Java guy on the java-dev mailing list:
System JVMs live under /System/Library/…
- These JVMs are only provided by Apple, and there is only 1 major
platform version at a time.- The one version is always upgraded, and only by Apple Software Updates.
- It should always be GM version, that developers can revert back to, despite
any developer previews or 3rd party
JVMs they have installed.- Like everything else in /System, it’s owned by root r-x, so don’t mess
with it!Developer JVMs live under /Library/Java/JavaVirtualMachines
- Apple Java Developer Previews install under /Library.
- The Developer .jdk bundles contain everything a developer could need
(src.jar, docs.jar, etc), but are too
big to ship to the tens of millions of
Mac customers.- 3rd party JVMs should install here.
Developers working on the JVM itself can use
~/Library/Java/JavaVirtualMachines
- It’s handy to symlink to your current build product from this
directory, and not impact other usersJava IDEs should probably bias to using /Library or ~/Library detected
JVMs, but should be able to fallback
to using /System/Library JVMs if
that’s the only one installed (but
don’t expect src or JavaDoc).This allows Java developers the
maximum flexibility to install
multiple version of the JVM to regress
bugs and even develop a JVM on the Mac
themselves. It also ensures that all
Mac customers have one safe, slim,
secure version of the JVM, and that we
don’t endlessly eat their disk space
every time we Software Update them a
JVM.
So, instead of pointing Intellij at /System/Library/Frameworks/JavaVM.framework, you should point to a JDK in either /Library/Java/JavaVirtualMachines or /System/Library/Java/JavaVirtualMachines