He is a entrepreneur and a software architect from Tel Aviv, Israel. He is also a technology freak with about 20 years experience working with computers. He is currently working on his first private initiative in the area of software development tools. His vision is to maximize the abilities of software developers by providing pragmatic tools that enable them to get fast results. Zviki has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

Eclipse, Java and Snow Leopard

09.01.2009
| 22038 views |
  • submit to reddit

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

Published at DZone with permission of its author, Zviki Cohen.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

tom van vleck replied on Sun, 2009/09/06 - 9:39am

You state "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."  This does not seem to be true.

I downloaded the 32-bit Cocoa Eclipse package from the website since no 64-bit version was available.

I unzipped and installed Eclipse on a clean Snow Leopard machine.  I copied over my workspace from Leopard. Eclipse started right up, opened my workspace, and appeared to work. It showed some compilation errors of Java programs because files were missing, and it appears that either Java or Eclipse has changed rules about package naming, but nothing serious.

So that's the good news.  Then I went into "Help :: nstall new software" and tried to install subclipse 1.6.x.  It did a lot of installing but at the end, the "SVN exploring" perspective was in angle brackes and all gray, and there was no SVN preference pane.  So perhaps that is the result of 32/64 problems, or an incomplete install, or .. who knows, ghosts.

 

Christophe Bouhier replied on Wed, 2009/09/09 - 2:27pm

My experience with SL and Eclipse. Before installing SL, I was running a fresh copy of Galileo Cocoa 32 bit obviously (as there is no 64bit), I upgraded to SL, and not aware of the changes in SL, I launched eclipse and all seemed fine. I continued my daily programming, and the RCP app wouldn't launch with error:
java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:182)
I suspected some 32-bit dependencies, and there for made a fresh RCP, but the same error. So it's not my app, but seriously the 64-bit VM, did some digging in Java settings, in contrary to what you write, changing to the 32-bit 1.6 J2SE JVM, didn't do the trick. Checked the settings in Eclipse for JRE/Execution environment, this still points to 1.5 as preferred JVM, but when checking the actual path I see this:
drwxr-xr-x  11 root  wheel  374  3 sep 09:11 .
drwxr-xr-x  11 root  wheel  374  3 sep 09:11 ..
lrwxr-xr-x   1 root  wheel    5  3 sep 09:11 1.3 -> 1.3.1
drwxr-xr-x   3 root  wheel  102 21 jul 01:35 1.3.1
lrwxr-xr-x   1 root  wheel   10  3 sep 09:11 1.5 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10  3 sep 09:11 1.5.0 -> CurrentJDK
lrwxr-xr-x   1 root  wheel    5  3 sep 09:11 1.6 -> 1.6.0
drwxr-xr-x   7 root  wheel  238  3 sep 09:11 1.6.0
drwxr-xr-x   8 root  wheel  272  3 sep 09:11 A
lrwxr-xr-x   1 root  wheel    1  3 sep 09:11 Current -> A
lrwxr-xr-x   1 root  wheel    3  3 sep 09:11 CurrentJDK -> 1.6
So 1.5 in Eclipse points to 1.6, but doesn't use the 32 bit JVM. When changing the version with Java preferences, I do see that a simple java -version actually does changed between 32 and 64 bit. I am bit lost here, the JVM seems to be changed, but eclipse doesn't pick it up! Christophe

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.