c0d3x
c0d3x

Reputation: 2673

Howto start eclipse in JDK?

I just installed a Maven plug-in into eclipse the first time. Now there is a message on eclipse startup, that i should start eclipse in JDK not jre to make Maven components run fine. There is a -vm argument which I used in the eclipse.ini:

-vm C:\Program Files (x86)\Java\

But the message is still there after restart.

I've tried the:

C:\Program Files (x86)\Java\bin

and also the:

C:\Program Files (x86)\Java\bin\java.exe

But nothing changed.

How do I start eclipse in JDK?

Thanks in advance.

Upvotes: 11

Views: 25578

Answers (4)

jamiebarrow
jamiebarrow

Reputation: 2517

Found how to add it to the INI, must add the parameter to the line below the -vm option, as below:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:\Program Files\Java\jdk1.6.0_17\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

Upvotes: 4

Lumpy Oatmeal
Lumpy Oatmeal

Reputation: 186

If you're using Windows, right click on your eclipse shortcut and select Properties, in the Shortcut tab you can change what's in the Target: box to specify the jdk. I use

"C:\Program Files\eclipse-jee-galileo-sr1 (3.5.1)\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe" -vmargs -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode

For some reason I couldn't get it to use the jdk when I tried editing the eclipse.ini file.

Upvotes: 12

VonC
VonC

Reputation: 1329292

You have many more options in the Equinox Launcher page.

And you have an example of a complete eclipse.ini with all options there.


When no -vm is specified, the launcher looks for a virtual machine first in a jre directory in the root of eclipse and then on the search path. If java is found in either location, then we look for a jvm shared library (jvm.dll on window, libjvm.so on *nix platforms) relative to that java executable.

If a jvm shared library is found we load it and use the JNI invocation api to start the vm. If no jvm shared library is found, we exec the java launcher to start the vm in a new process. -vm specified on command line or in eclipse.ini
Eclipse can be started with "-vm <location>" to indicate a virtual machine to use. There are several possibilities for the value of <location>:

  • java.exe/javaw.exe: <location> is a path to a java launcher. We exec that java launcher to start the vm in a new process.
  • jvm.dll or libjvm.so: <location> is a path to a jvm shared library. We attempt to load that library and use the JNI Invocation API to start the vm in the current process.
  • vmDesc.ee: <location> is a path to a file ending in ".ee". This file is expected to describe the execution environment for a jvm. See the Execution Environment Descriptions page.
  • directory: <location> is a directory. We look in that directory for:
    • (1) a default.ee file,
    • (2) a java launcher or
    • (3) the jvm shared library.
      If we find the jvm shared library, we use JNI invocation.
      If we find a launcher, we attempt to find a jvm library in known locations relative to the launcher.
      If we find one, we use JNI invocation. If no jvm library is found, we exec java in a new process.

Upvotes: 2

Bill the Lizard
Bill the Lizard

Reputation: 406105

You can specify which JVM to launch Eclipse under in your eclipse.ini file. There are detailed instructions for different operating systems on the Eclipse wiki.

Upvotes: 4

Related Questions