title: m2eclipse is unable to locate C:\Program Files\Java\jre6\..\lib\tools.jar
body: <p>I have a problem, concerning the jdk/jre usage of my eclipse. I know that this question was asked and answered a lot of times here and I researched what could be wrong for quite a while. I actually didn't find anything so I'm going to ask you again. Maybe I'm missing something (if yes, I hope it's not to embarrasing :)</p>
  
  <p>My problem is, that when I'm running mvn clean install I get an error which says that the m2eclipse plugin is "Unable to locate the Javac Compiler in: C:\Program Files\Java\jre6..\lib\tools.jar".</p>
  
  <p>First thing I checked was if the right JRE was configured in eclipse. So I switched into Window > Preferences > Java > Installed JREs and checked if the selected jre is the jre inside my jdk folder. This was the case. </p>
  
  <p>I checked the eclipse.ini and added a -vw flag to it. It now looks like:</p>
  
  <pre><code>-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.java.product
  --launcher.defaultAction
  openFile
  --launcher.XXMaxPermSize
  256M
  -showsplash
   org.eclipse.platform
  --launcher.XXMaxPermSize
  256m
  --launcher.defaultAction
  openFile
  -vm
  "%JAVA_HOME%\bin\javaw.exe"
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx384m
  </code></pre>
  
  <p>The %JAVA_HOME% is resolved to C:\Program Files\Java\jdk1.6.0_24. Since it contains a space I surrounded the vw path with quotes. To check if the path is really correct I tried</p>
  
  <pre><code>C:\Windows\System32&gt;echo %JAVA_HOME%
  C:\Program Files\Java\jdk1.6.0_24
  </code></pre>
  
  <p>which tells me that it is correct. I also tried to pass the -vw option when eclipse is started. So the command to start eclipse was then</p>
  
  <pre><code>D:\Programs\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe"
  </code></pre>
  
  <p>I also tested if there is a difference when I use the %JAVA_HOME% notation or if I writed the full path (it makes no difference).</p>
  
  <p>The configuration of eclipse, which I get when I go to Help > About Eclipse > Installation Details > Configuration, looks like that:</p>
  
  <pre><code>__wbp.gwt.useWebKit=true
  awt.toolkit=sun.awt.windows.WToolkit
  veclipse.application=org.eclipse.ui.ide.workbench
  eclipse.buildId=M20120208-0800
  eclipse.commands=-os
  win32
  -ws
  win32
  -arch
  x86_64
  -showsplash
  -launcher
  D:\Programs\eclipse\eclipse.exe
  -name
  Eclipse
  --launcher.library
  D:\Programs\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110    502\eclipse_1406.dll
  -startup
  D:\Programs\eclipse\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
  --launcher.overrideVmargs
  -exitdata
  3e30_64
  -product
  org.eclipse.epp.package.java.product
  -vm
  C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
  eclipse.home.location=file:/D:/Programs/eclipse/
  eclipse.launcher=D:\Programs\eclipse\eclipse.exe
  eclipse.launcher.name=Eclipse
  eclipse.p2.data.area=@config.dir/../p2/
  eclipse.p2.profile=epp.package.java
  eclipse.product=org.eclipse.epp.package.java.product
  eclipse.startTime=1335643108722
  eclipse.vm=C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
  eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx384m
  -XX:MaxPermSize=256m
  [...]
  </code></pre>
  
  <p>I also tried to use the javaw.exe that is located in %JAVA_HOME%\jre\bin\ which also doesn't change anything.</p>
  
  <p>One thing that is a little bit strange is, that if I delete the reference to the jre, the one that is not included in jdk, in Window > Preferences > Java > Installed JREs I get an error which says "The specified JRE installation does not exist". </p>
  
  <p>Does anyone have an idea what I'm doing wrong? I think I tried anything to make it work and according to the other articles I found I'm doing it right.</p>
  
  <p>Btw: I did some Maven "Update Project Dependencies" and "Update Dependencies" which work, so I did not get any error there. The only thing, I did not do is to restart my computer...</p>