Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] m2e using my JRE to run javaw.exe within eclipse

Hi Adam,

> I'm having a pretty significant problem with m2e in eclipse. First,
> build info. I'm using

>
> Eclipse Indigo Service Release 1, 20110916-0149

> m2e 1.0.200.20111228-1245
> JDK 1.7.0_02
>
> I also have installed

> JRE7 (important later)
>
> My problem is that when I right click on a project, select "Run As,"
> and select any of the maven targets (except for "Maven build..."
> which allows me to specify information), my JRE (the aformentioned
> JRE7) will be invoked to perform the task. JRE7's javaw.exe will be
> used, and my compiles/installs will FAIL because javac, etc will not
> be available.

>
> My JAVA_HOME is set to the JDK

> Eclipse is started using the JDK
> In eclipse preferences, Java -> Installed JREs, I have both the JRE
> and JDK, and the JDK is checked

>
> I modified my eclipse.ini to include

> -vm
> C:/Program Files/Java/jdk1.7.0_02/bin/javaw.exe
>
> Yesterday, the eclipse.ini change SEEMED like it was causing this to
> work, but today I've regressed to the earlier behavior.

>
> Any help in trying to figure out just how to fix this permanently
> would be tremendously appreciated.


I have seen this behaviour a couple of times on Windows machines. My workaround was to change some entries in the registry:

Start the registry editor, go to HKLM\Software\JavaSoft\Java Runtime Environment. There you'll find subentries for the different JDKs you have installed, at least two for each major version:
* 1.6 and 1.6.0_<version> for Java 6
* 1.7 and 1.7.0_<version> for Java 7

Each one contains properties "JavaHome" and "RuntimeLib". These normally point to the plain JRE installation on your machine which doesn't contain the Java compiler. Try to change them and let them point to the additional JRE installation under your JDK installation directory. Example:
* JavaHome:   C:\Program Files\Java\jdk1.6.0_31\jre
* RuntimeLib: C:\Program Files\Java\jdk1.6.0_31\jre\bin\client\jvm.dll

Then everything should work.



HTH

Thorsten

Back to the top