简体   繁体   English

配置m2eclipse:“ Eclipse在JRE中运行,但需要JDK”

[英]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. 安装m2eclipse之后,我收到一条消息,说Eclipse需要“在JDK中运行”并更新eclipse.ini来这样做。

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. 作为Eclipse安装目录中eclipse.ini文件的最后两行。

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. 该值必须是Java可执行文件的完整绝对路径,而不仅仅是Java主目录。

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

should work. 应该管用。 source: http://wiki.eclipse.org/Eclipse.ini 来源: http//wiki.eclipse.org/Eclipse.ini

It can be path to JDK if you're using command line. 如果使用命令行,它可以是JDK的路径。 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. 我通常使用额外的参数来创建Eclipse的快捷方式:-vm“ path_to_jdk”,它将使用jvm.dll(jvm.so)而不是java.exe,javaw.exe,因此您不会看到外部进程名称java。 exe在您的进程列表中。

Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, .... 令人难以置信的是,该问题的解决方案与斜杠,反斜杠,引号,空格,jre,jdk,jvm,javaw等无关。

The answer is that you have to have a line break between 答案是您必须在

-vm -vm

and the path. 和路径。

So in the eclipse.ini file: 因此,在eclipse.ini文件中:

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\

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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