欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maven插件问题 ----- Eclipse is running in a JRE, but a JDK is required错误的解决

程序员文章站 2022-04-28 09:20:58
...
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


-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-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 Files\Java\jdk1.7.0_15\bin\javaw.exe
-----------------
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m



[size=x-large]
注意位置[/size]


[url]http://liguoliang.com/2010/eclipse-is-running-in-a-jre-but-a-jdk-is-required/[/url]

[url]http://xucons.iteye.com/blog/475204[/url]