How do I set the eclipse.ini -vm option?
Asked Answered
S

13

90

I installed the Maven plugin for Eclipse, and then I got an error like below:

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

How do I use the -vm option to point to my JDK in eclipse.ini?

Suber answered 25/5, 2009 at 6:42 Comment(2)
wiki.eclipse.org/Eclipse.iniTirza
Make sure that -vm comes before -vmargs in the eclipse.ini file.Bering
S
112

My solution is:

-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
Suber answered 25/5, 2009 at 7:13 Comment(3)
See also #142857Thermoluminescent
On Unix systems use java instead of javaw.exePart
Note that recent versions (2022 or so) of Eclipse already have a -vm option in the eclipse.ini file, just before -vmargs and that -vm overrides a previous -vm option at the begin of file.Recurve
P
68

eclipse.ini file must have -vm on the first line and a path on the second line. Don't try to put everything into one line!

-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
Photomechanical answered 16/3, 2010 at 13:42 Comment(1)
Thanks for the "onel line" trick. -vm "C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe" on one line does not work.Ribeiro
S
47

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

Spaghetti answered 14/8, 2010 at 19:20 Comment(2)
This is the missing bit of information as well as not putting -vm and the path on the same lineValvule
Also one other thing to note, do not open the ini file in notepad as it will display incorrectly. Open it in another editor, e.g. notepad++Valvule
E
25

There is a wiki page here.

There are two ways the JVM can be started: by forking it in a separate 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 JVM will be forked in a separate process. You can also specify -vm with a path to the jvm.dll so that the JVM 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 separate line. It won't work if you put the "-vm" and the path on the same line.

Eohippus answered 25/5, 2009 at 19:50 Comment(0)
O
14

-vm

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

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

See here: Find the JRE for Eclipse

Onrush answered 24/7, 2009 at 22:27 Comment(0)
G
12

My solution for Ubuntu Linux:

-vm
/home/daniel/Downloads/jdk1.6.0_17/bin
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
Goodwife answered 9/5, 2012 at 17:10 Comment(1)
It is important to add this new lines before -vmargs declaration. Like one the top of file.Counsel
B
10

I am not sure if something has changed, but I just tried the other answers regarding entries in "eclipse.ini" for Eclipse Galileo SR2 (Windows 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.

Bova answered 26/4, 2010 at 20:3 Comment(0)
L
5

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 the -vmargs line and anything for JVM should be after the -vmargs line.

Linguiform answered 25/5, 2009 at 6:53 Comment(0)
W
4

The JDK you're pointing to in your eclipse.ini has to match the Eclipse installation.

If you are running a 32- or 64-bit Eclipse, use a 32 or 64-bit Java JDK, respectively.

Withdrawal answered 19/4, 2011 at 17:46 Comment(0)
T
3

I'd like to share this little hack:

A click on the Eclipse's icon indicated a problem with the JRE. So, I put this command in the destination field of the icon's properties:

C:\...\eclipse.exe -vm c:\'Program Files'\Java\jdk1.7.0_51\jre\bin\javaw

Thinking that the "'" would solve the problem with the space in the path. That did not function. Then, I tried this command:

C:\...\eclipse.exe -vm c:\Progra~1\Java\jdk1.7.0_51\jre\bin\javaw

with success

Towboat answered 27/1, 2014 at 16:10 Comment(0)
L
2

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

Luo answered 25/5, 2009 at 6:58 Comment(0)
P
2

Assuming you have a jre folder, which contains bin, lib, etc files copied from a Java Runtime distribution, in the same folder as eclipse.ini, you can set in your eclilpse.ini

-vm
jre\bin\javaw.exe
Parahydrogen answered 8/12, 2011 at 22:16 Comment(0)
O
-2
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms2000m
-Xmx3512m
Opiumism answered 5/4, 2016 at 6:33 Comment(1)
This does not set the JVM and is needlessly requesting huge amounts of memory.Phlebosclerosis

© 2022 - 2024 — McMap. All rights reserved.