Eclipse安装了Maven插件后,可能会报这种错误:
控制台出现:
1. Eclipse is running in a JRE, but a JDK is required
2. Some Maven plugins may not work when importing projects or updating source folders.
Eclipse is running in a JRE, but a JDK is required
Some Maven plugins may not work when importing projects or updating source folders.
这是因为在Eclipse.ini配置中没有指定-vm参数,修改如下重启Eclipse问题就解决了:
1. 检查Eclipse正在使用的JRE
‘Window’ -> ‘Preferences’ -> ‘Java’ -> ‘Installed JREs’ 确定正在使用JDK而非JRE.
2. 配置Eclipse.ini
加
-vm
C:\Program Files\Java\jdk1.7.0_15\bin\javaw.exe
-startupplugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807-productorg.eclipse.epp.package.jee.product--launcher.defaultActionopenFile--launcher.XXMaxPermSize256M-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m--launcher.defaultActionopenFile------------------vmC:\Program Files\Java\jdk1.7.0_15\bin\javaw.exe------------------vmargs-Dosgi.requiredJavaVersion=1.5-Dhelp.lucene.tokenizer=standard-Xms40m-Xmx512m
注意位置
http://liguoliang.com/2010/eclipse-is-running-in-a-jre-but-a-jdk-is-required/
http://xucons.iteye.com/blog/475204