Friday, January 26, 2007

Eclipse startup error

If you are getting an error dialog titled "Incompatible JVM" when you are starting up Eclipse 3.2 - Just make sure that your PATH points to the correct JVM.. If you have more than one JVMs installed, the correct JVM path should come earlier in the PATH variable. Else you would be thinking - Hey, I have the correct JVM on the PATH, then why is it not finding it.

You need to point to the correct folder, which contains java.exe.

Eclipse 3.2 (IIRC, also 3.1 and 3.0) needs atleast Java 1.4.2 installed. It would just not work with anything lower than that. So when I saw that I do have Java 1.4.2 installed and its present in the PATH variable, still it tells me that the JVM is incompatible, it really got me confused.

My PATH variable is as below:

C:\Sun\AppServer\jdk\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

Earlier, the "C:\Sun\AppServer\jdk\bin" (the path to my 1.4.2 JDK) was at the end. So it tried to use the java.exe on "C:\Program Files\Oracle\jre\1.3.1\bin" (The first java.exe that it finds in the path, when looking for programs). And it invariably failed.

To correct this, make sure your java 1.4.2 (or higher) installation comes first on the path. Eclipse will try to use the first Java runtime that it can find.

If you have only a single JDK (search for javac.exe or java.exe on your computer, to find out the number), and you get this error, you need to upgrade to atleast Java 1.4.2.

Update

Sabarish, in the comments section, points out using another way. Using the -vm option to specify what JVM should Eclipse use.

To run eclipse in this manner, enter below in the run dialog. This is the path as per my machine, the paths would change as per your machine.

d:\eclipse\eclipse.exe -vm C:\Sun\AppServer\jdk\bin\javaw

Or simply, create a shortcut to eclipse.exe, rightclick on the shortcut, go to properties. Go to the shortcut tab, and specify the above command in the textbox labelled Target and apply. This would make it convinient.

4 Comments:

Blogger Sabarish Sasidharan said...

Another option is to use the -vm cmdline option when starting eclipse, without bothering with the PATH.

February 12, 2007 7:56 PM  
OpenID Luke said...

In Windows, I wrote this CMD to get it working for me.
"c:\program files\eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0_21\bin\java.exe"

September 22, 2010 12:02 PM  
Anonymous rob said...

I didn't have the PATH variable, and I added it. now eclipse work, thank you!

November 23, 2011 3:25 AM  
Anonymous Anoop Kavalloor said...

Thank you very much. Your post helped me resolve my issue.

February 13, 2012 6:23 AM  

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home