[Update: Changed the title, added “on a Mac” because everything mentioned here is applicable to that platform alone]
After not looking at it for 4 years, today I started playing with Java again for a new open source project called RedCar, a programmers text editor that is now being ported to SWT and JRuby. Mat is getting pretty involved in it and he got me curious about the project. However to actually get it to work I had to get the Java 1.6 code to compile on my Mac which was a little tricky. Here are some notes from that.
The JDK 1.6 was part of one of the recent Mac Software updates but what I found out was that the update does not actually change the default JDK/JRE for the system. The first thing I did was to change the symlinks for java and javac as mentioned on this post. That seemed to work and calling java – version and javac -version seemed to return the correct versions, but running the build file still did not work. After a few other attempts, including trying the Java Preferences Application without any luck, I finally found this post that basically talked about the CurrentJDK symlink that apparently my build.xml was using (and was still pointed to JDK 1.5). That seems to have worked.
One last thing. Apparently Eclipse (and Flex Builder which is built on top of Eclipse) doesnt work with Java 1.6 on a Mac. As this post suggests, you may have to make a change to the Info.plist for the application to make it run with Java 1.5.
[Update] The Flash CS3 IDE doesnt work with 1.6 as well, so I am reverting back to 1.5 for the time being.
8 thoughts on “Migrating to Java 1.6 on a Mac (Warning: Flash CS3/Flex Builder/Eclipse wont work with it)”
That should be a MAC issue….
I use eclipse/flexbuilder/flashbuilder on top of java 6 for years.
Since java 6 was released….
@VELO as last link in the post above mentions, the bug is because elipse uses 32-bit SWT-Cocoa bindings, and Apple just decided that they werenâ€™t going to support 32-bit SWT any more in Java 6. So yes, its a Mac only thing.
Try opening up the FB package and adding -d32 to the jvm arguments. That should get it back in 32-bit mode and you should be OK (we hope). We have tried running FB3 on Snow Leopard which does use Java 6 by default I think it works.
The gist of it is to force your phone to restart by pressing and holding the power button and the volume down button at the same time until you see the Apple logo on the screen. Then let go of the buttons and allow the phone to start up normally.
If a forced restart doesn’t solve it, then use the page I linked and follow the steps laid out there.