简体   繁体   中英

configuring m2eclipse: “Eclipse is running in a JRE but a JDK is required”

After installed m2eclipse, I received a message saying that Eclipse needs to "run in a JDK" and to update the eclipse.ini to do so.

So I added this:

-vm
C:\Program Files (x86)\Java\jdk1.6.0_20

as the last two lines of the eclipse.ini file in my Eclipse installation directory.

However, I am again receiving this warning.

Did I not enter the command correctly?

The value must be the full absolute path to the Java executable, not just to the Java home directory.

-vm
C:\Program Files (x86)\Java\jdk1.6.0_20\bin\javaw.exe

should work. source: http://wiki.eclipse.org/Eclipse.ini

It can be path to JDK if you're using command line. I usually create a shortcut to eclipse with extra parameter: -vm "path_to_jdk", it'll using jvm.dll(jvm.so) instead of java.exe,javaw.exe, so you won't see external process name java.exe in your process list.

Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....

The answer is that you have to have a line break between

-vm

and the path.

So in the eclipse.ini file:

THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:
-vm
C:\java\jdk\bin\javaw.exe

在尝试了该线程中的所有建议之后,我唯一可以使用Eclipse Indigo的方法是使用带有-vm开关的快捷方式,如下所示:

"C:\Program Files\Eclipse Indigo 3.7M6\eclipse.exe" -vm C:\Progra~1\Java\jdk1.7.0\bin\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM