Eclipse, Java and Snow Leopard

DZone 's Guide to

Eclipse, Java and Snow Leopard

· Java Zone ·
Free Resource

I'm getting about 50 hits a day from people searching for the simple answer "Eclipse Cocoa vs. Carbon" and ending up in my previous article. In the past, I recommended installing Eclipse Cocoa 32-bit. However, now that Snow Leopard (SL) is out, the situation changed and an update is in order.

There are some major news regarding Java in SL. First, it ships with Java 6 only. This includes 32-bit and 64-bit versions. The 32-bit is something which was unknown until the release of SL and it means Java 6 will be available on older intel machines which are not 64-bit capable (Intel Core Duo). Second, the 64-bit version is the default for users running 64-bit capable machines (Intel Core 2 Duo).

This means that unsuspecting users downloading Eclipse from eclipse.org will not be able to run it because the default Cocoa packages are 32-bit. There are a number of options for SL users: 

  1. Change the default JVM to 32-bit using the Java Preferences application (under /Applications/Utilities).
  2. Change the JVM for the Eclipse instance specifically. That's more of a hassle.
  3. Work with 64-bit Eclipse. This installation may require more work, as there are no ready made Eclipse Packages for 64-bit Cocoa at the time of this writing.
In the past, I argued that running Eclipse in 64-bit has no advantage and just wastes memory. This may be the case in Leopard, but in SL, the situation may be different. The following is a quote from a comment on my previous post by Mike Swingler, a Java Runtime Engineer at Apple: " There is no reason to not use Cocoa/64-bit. Snow Leopard ships with Java SE 6 64-bit by default, and every other app on the system is 64-bit as well. Loading a 32-bit Eclipse is only going to page in a complete copy of every dependent framework on the system and waste time and space."

If this is the case, you should be running Eclipse in 64-bit Cocoa in Snow Leopard. My recommendation regarding Leopard is still the same.

There are no ready-made packages (e.g. JEE, PHP, etc.) for this architecture (vote for this bug if you want the situation to change). However, you can download the basic Eclipse Classic directly from the Eclipse.org downloads page (64-bit available only for the Eclipse Classic) and install the plugins as one package in a very simple process. See this post for a complete screencast or this post if you prefer simple screenshots walkthrough.

Finally, if you plan to do some Java development, you may find out that your JREs are not working properly. In that case, you can just delete your current JREs and search for new ones. This can be done under Eclipse -> Preferences -> Java -> Installed JREs. Also make sure that you have a working JRE selected for your Java projects, in the Project settings (under Build Path -> Libraries).

From http://blog.zvikico.com


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}