title: Eclipse JVM configuration
body: <p>Background: I've got a new eclipse installation and have installed the m2eclipse plugin. After startup m2eclipse generates the message:</p>
  
  <blockquote>
    <p>Eclipse is running in a JRE, but a JDK
    is required</p>
  </blockquote>
  
  <p>Following the instructions from <a href="http://blog.dawouds.com/2008/11/eclipse-is-running-in-jre-but-jdk-is.html" rel="noreferrer">here</a> I've changed the eclipse.ini file to use the JDK JVM:</p>
  
  <pre><code>-startup
  plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.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
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx512m
  -vm
  "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
  </code></pre>
  
  <p>After restarting eclipse however, I still get the message saying its running under the JRE and not the JDK. </p>
  
  <p>Looking at the eclipse configuration via <em>Help -> About Eclipse -> Installation Details -> Configuration</em> it seems like eclipse is picking up the JVM configuration details from somewhere else:</p>
  
  <pre><code>...
  -vm
  C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
  eclipse.home.location=file:/C:/Program Files (x86)/eclipse/
  eclipse.launcher=C:\Program Files (x86)\eclipse\eclipse.exe
  eclipse.p2.data.area=@config.dir/../p2/
  eclipse.p2.profile=epp.package.jee
  eclipse.product=org.eclipse.epp.package.jee.product
  eclipse.startTime=1252669330296
  eclipse.vm=C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
  eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx512m
  -vm
  "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
  -XX:MaxPermSize=256m
  ...
  </code></pre>
  
  <p>My question is where is the first <em>-vm</em> argument coming from and how can I remove or change it?</p>
  
  <p>Thanks</p>
  
  <p><strong>Update</strong>: I have updated the eclipse.ini file as per VonC's answer. I'm now getting an error when launching eclipse saying:</p>
  
  <blockquote>
    <p>A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"</p>
  </blockquote>
  
  <p>I've confirmed that the path is correct and can be executed via the command line.</p>
  
  <p>Complete eclipse.ini below:</p>
  
  <pre><code>-startup
  plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.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_16\bin\javaw.exe"
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx512m
  </code></pre>
  
  <p><strong>Solution:</strong> it seems like there was still something wrong with the eclipse.ini file. I replaced it completely with the settings given by VonC in the post he linked and eclipse is now starting properly and using the correct JVM. Full eclipse.ini below for anyone else with the same problem:</p>
  
  <pre><code>-showlocation
  -showsplash
  org.eclipse.platform
  --launcher.XXMaxPermSize
  384m
  -startup
  plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
  --launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
  -vm
  C:\Program Files (x86)\Java\jdk1.6.0_16\jre\bin\client\jvm.dll
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms128m
  -Xmx384m
  -Xss4m
  -XX:PermSize=128m
  -XX:MaxPermSize=128m
  -XX:CompileThreshold=5
  -XX:MaxGCPauseMillis=10
  -XX:MaxHeapFreeRatio=70
  -XX:+UseConcMarkSweepGC
  -XX:+CMSIncrementalMode
  -XX:+CMSIncrementalPacing
  -Dcom.sun.management.jmxremote
  -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/jv/eclipse/mydropins
  </code></pre>