Java

Eclipse, Maven and JRE..

Posted in Computers, Java, Programming on May 19th, 2010 by Kedar – Be the first to comment

I had a strange error with Eclipse today when I tried to integrate with Maven. Everytime I started Eclipse I got the error as it was building the workspace:

The Maven Integration requires that Eclipse be running in a JDK, because a number of Maven core plugins are using jars from the JDK.
Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JREs are also using JDK installs.

Now this was a bit surprising because I had chosen a JDK as my default JRE in my Eclipse Preferences. After Googling I found that people talked about editing eclipse.ini and adding -vm option or specifying this option on the Eclipse command line. It still did not work for me.

First let’s see what environment I had. I have a 64-bit Windows 7 laptop. I had installed the 64-bit JDK (installed in C:\Program Files). The latest Eclipse that I had downloaded did not have a 64-bit Windows version.

When I tried using this 64-bit JDK in the -vm command line option (or eclipse.ini),

-vm "C:\Program Files\Java\jdk1.6.0_17\bin"

it crashed or just defaulted back to the JRE it originally had which was:

C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll

So I downloaded and installed a 32-bit JDK. Now my -vm option in Eclipse command line (or in eclipse.ini) was

-vm "C:\Program Files (x86)\Java\jdk1.6.0_20\bin"

This fixed it!