The main problems I'm having are:
- How to enforce Java6 64bit JVM as the default on MacOS?
- How to make IntelliJ use it?
- How to make Safari (and may be one day Firefox) use it
I know I'm loosing SWT, and many soft (like NetBeans and IntelliJ) enforce Java 5 has hard coded default on the Mac, but I'm developing in Fan and the IntelliJ Fan Plugin, and Java 6 is kind of a must :)
So, here is what I do:
On each update of Java6 from Apple
- As root I go under:
cd /System/Library/Frameworks/JavaVM.framework/Versions/ - There should be a symlink: CurrentJDK -> 1.5
- Then I change the link:
rm CurrentJDK && ln -s 1.6 CurrentJDK
On each update of IntelliJ
- Download the idea-XXX.dmg, the idea-XXX.tar.gz (64 bit not the jdk15 version), and idea-XXX-dev.zip. I hope JetBrains will start giving dmg files for the 64 bit JVM, because it's big downloads :(
- Copy the "IntelliJ IDEA XXX.app" folder from DMG to Applications. I have /Applications/IntelliJ and /Applications/NetBeans with the versions I used, it helps when I'm messing up :)
- Do a copy of it under "IntelliJ IDEA XXX-jdk15.app" for backup and to be able to compile IntelliJ plugin for 1.5
- Extract the idea-XXX.tar.gz under /Applications/IntelliJ
- Copy all the jar files from idea-XXX to "IntelliJ IDEA XXX.app". I do as root under idea-XXX:
find . -name "*.jar" -exec cp \{\} ../IntelliJ\ IDEA\ XXX.app/\{\} \; - Change the "IntelliJ IDEA XXX.app/Contents/Info.plist" with:
<key>JVMVersion</key>
<string>1.6*</string>
<key>VMOptions</key>
<string>-Xms400m -Xmx1248m -XX:MaxPermSize=192m -XX:PermSize=192m -Xbootclasspath/a:../lib/boot.jar -ea</string> - Here usually I try to run "open /Applications/IntelliJ IDEA XXX.app" and I get:
LSOpenFromURLSpec() failed with error -10810 for the file /Applications/IntelliJ/IntelliJ IDEA XXX.app - The the solution is (as root):
cp /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub64 /Applications/IntelliJ/IntelliJ\ IDEA\ XXX.app/Contents/MacOS/idea
For Safari and Firefox, I still don't manage to do it!
Hope I won't have to do this too much in the future, once everyone agrees on JDK 1.6 64 bits as Mac OS X default.