Specifying the JVM to run Eclipse with

Specifying the JVM Eclipse should use is both a nice way to make sure it is correct now and to know that future upgrades/updates won’t mess with this.

This is done by specifying the -vm option in the “eclipse.ini” file.

Important bits to know about this:

  • -vm option and the path must not be on the same line
  • You should give the Java excecutable here, not just the path where is is located
  • if you also have -vmargs the -vm must be before that in the ini file

Example eclipse.ini (for windows)

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\progra~1\Java\jdk1.6.0_26\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m