views:

655

answers:

4

I just installed Java 1.6 on my OSX and everything works brilliantly, except that Eclipse refuses to start. It puts up a huge prompt from which I can't copy/paste, but it's clearly stating that it wants to be using Java 1.5 and can't find it anymore.

I don't see anything in its configuration files about which version of Java it should be looking for. Has anyone dealt with this?

Thanks in advance.

A: 

You should switch to your previous version of Java, under Utilities, Java Preferences, and dragging 1.5 32 bit as the first choice.

The reason for the error is that the bundled SWT JINI libraries seem to be compiled for only certain platforms.

You can always check the Console for specific error messages.

Andrei Tanasescu
You mean do this just while running Eclipse? I need 1.6 to do other things.
Dr.Dredel
+1  A: 

on /Applications/Eclipse/Eclipse.app right click and choose "Show Package Contents" open Contents/Info.plist with a text editor NOT plist editor

add <string>-vm</string> <string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>

to

<key>Eclipse</key>
     <array>
<!-- add it here -->
</array>

save it and restart.

Clint
/1.5.0/Commands/java seems to be a link to /Home/bin/java, which is now 1.6. Should I use /1.5.0/home/bin/java instead?
Dr.Dredel
The link is to ../Home/bin/java which has an absolute path of /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java
Clint
Thanks very much.
Dr.Dredel
Don't forget that the same applies to the default VM when launching Java processes from within Eclipse. Specifically, if you are doing Eclipse plugin/RCP development, you will need to specify the 1.5 VM as default for running your applications from within Eclipse launch configurations or preferences.
zvikico
+2  A: 

Unless I'm mistaken, the Java 1.6 vm on the Mac is 64 bit only. To use it, you'll need a 64bit version of Eclipse. The only 64bit port of eclipse on the mac is the new cocoa build, find it here.

In a few weeks, the Galileo release will be finished, there you can find the 64 bit cocoa port by going to Eclipse Classic -> Other Downloads.

If you want to keep your current eclipse install, you'll have to do as the other answers suggest and change them to use 1.5

Andrew Niefer
Galileo is released in less than a week and, although it supports 64 bit, I'd still recommend using the 32 bit version. The 64 bit does seem a bit more memory hungry.
zvikico
Isn't that the whole point of 64bit? (Except on MacOS where you have no choice for java6). The advantage of 64 bit is addressing more memory, which comes at the cost of larger objects since the pointers are twice as large. (I don't know if the mac vm does compressed references.)
Andrew Niefer
The point is to enable addressing larger space. However, if on a normal operation (having two JVMs do exactly the same thing) the 64-bit JVM consumes more memory, there's no point in running it in 64-bit mode.
zvikico
A: 

The above tip worked perfectly for me! Thanks!