(方法一)原址:http://xucons.javaeye.com/blog/475204
Eclipse安装了Maven插件后,可能会报这种错误: “Eclipse is running in a JRE, but a JDK is required”
这是因为在Eclipse.ini配置中没有指定-vm参数,修改如下重启Eclipse问题就解决了:
eclipse.ini 写道-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 FilesJavajdk1.6.0_10binjavaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
(方法二)
对于m2eclipse的插件,需要eclipse运行于jdk而不是jre,
打开eclipse,看到错误
Eclipse is running in a JRE, but a JDK is required
解决方法:
在eclipse目录下eclipse.ini,添加如下两行,注意这行要加在-vmargs之前,
-vm
C:Program FilesJavajdk1.5.0_16binjavaw.exe
比如我的文件如下:
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vm
C:Program FilesJavajdk1.5.0_16binjavaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m