views:

17578

answers:

8

I installed maven plugin for eclipse, then I get an error like below:

please make sure the -vm option in eclipse.ini is pointing to a JDK

how to use -vm option to point to my jdk in eclipse.ini?

+1  A: 

You have to edit the eclipse.ini file to have an entry similar to this...

C:\Java\JDK\1.5\bin\javaw.exe (your location of java executable)
-vmargs
-Xms64m   (based on you memory requirements)
-Xmx1028m

also remember that in eclipse.ini, anything meant for eclipse should be before -vmargs line and anything for JVM should be after -vmargs line.

+1  A: 

I know that there exists an command line option -vm to specify the path to executable of the java runtime. This may be the same as in eclipse.ini.

chrmue
+11  A: 

let me share my solution

-vm 
D:/work/Java/jdk1.6.0_13/bin/javaw.exe
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
cometta
See also http://stackoverflow.com/questions/142357/what-are-the-best-eclipse-34-jvm-settings#144349
VonC
+2  A: 

There is a wiki page here.

There are two ways the jvm can be started: by forking it in a seperate process from the eclipse launcher, or by loading it in-process using the JNI invocation API.

If you specify -vm with a path to the actual java(w).exe, then the vm will be forked in a separate process. You can also specify -vm with a path to the jvm.dll so that the vm is loaded in the same process:

-vm
D:/work/Java/jdk1.6.0_13/jre/bin/client/jvm.dll

You can also specify the path to the jre/bin folder itself.

Note also, the general format of the eclipse.ini is each argument on a seperate line, it won't work if you put the "-vm" and the path on the same line.

Andrew Niefer
+2  A: 

-vm

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

remember, no quotes. no matter if your path has spaces. (opposed to command line execution)

see here: Find the JRE for Eclipse

+4  A: 
Mike B.
+1  A: 

Not sure if something has changed, but I just tried the other answers regarding entries in "eclipse.ini" for Eclipse Galileo SR2 (Win XP SR3) and none worked. Java is jdk1.6.0_18 and is the default Windows install. Things improved when I dropped "\javaw.exe" from the path.

Also, I can't thank enough the mention that -vm needs to be first line in the ini file. I believe that really helped me out.

Thus my eclipse.ini file starts with:

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

FYI, my particular need to specify launching eclipse with a jdk arose from my wanting to work with the m2eclipse plugin.

hypotechguy
+5  A: 

Anything after the "vmargs" is taken to be vm arguments. Just make sure it's before that, which is the last pices in eclipse.ini

richard
Yes very important detail!
Patrick
Thanks for mentioning that.
Martin