Saturday, July 25, 2009

Setting-up VM Option in Eclipse

I was trying to play around with Maven and Eclipse. There was this nagging pop-up comes up every start-up saying,
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.
Googled and found jdk1.x.x/bin/javaw.exe should be passed as vm parameter. I kept this parameter at the end of eclipse.ini file and it did not work.

Here is what I did (in eclipse.ini file under %ECLIPSE_HOME%) to get this working:
  1. Located javaw.exe which was here: C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe
  2. Placed vm parameter just above -vmargs parameter
    like this:

    -vm
    C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe

  3. You must note two things here
    a. -vm and location of VM (C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe) has to be in separate lines.
    b. No - quote -- even if there exists a space in the path, the path should not be enclosed with double quotes.

Here is how my %ECLIPSE_HOME%/eclipse.ini looks like (click the image to see clearer)












References:
  1. Eclipse SDK Help