Migrating to Java 1.6 on a Mac (Warning: Flash CS3/Flex Builder/Eclipse wont work with it)

[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.

7 thoughts on “Migrating to Java 1.6 on a Mac (Warning: Flash CS3/Flex Builder/Eclipse wont work with it)”

  1. @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.

    Like

  2. 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.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s