Links <!-- #access --><!-- #masthead --><!-- #header -->
Eclipse is running in a JRE, but a JDK is required 解决方法
October 7, 2010 by Davlid, Li Guoliang,
<!-- .entry-meta -->
安装Maven后每次启动出现警告信息:
Eclipse is running in a JRE, but a JDK is required
Some Maven plugins may not work when importing projects or updating source folders.
分两步解决问题:
1. 检查Eclipse正在使用的JRE
‘Window’ -> ‘Preferences’ -> ‘Java’ -> ‘Installed JREs’ 确定正在使用JDK而非JRE.
如果没有JDK, 则先新增一个Standard VM.
2. 配置Eclipse.ini
检查Eclipse配置文件, 增加/编辑以下代码:
-vm
C:\Progra~2\Java\jdk1.6.0_16\jre\bin\javaw
注意事项:
1. 第一行参数名称, 第二行为值, 不能写到同一行中
2. 关于第二行的值, 因为不允许出现空格, 所以使用Progra~1或2 替代”Program Files (x86)”.
如果在Program Files下, 请使用Progra~1, 如果在x86下, 则使用Progra~2
3. 在文件中的位置, 不能放到最后(不能在-vmargs之后), 不放心的直接放到文件最前, 如:
-vm
C:\Progra~2\Java\jdk1.6.0_16\jre\bin\javaw
-startup
.....
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms240m
-Xmx912m
3. 重启Eclipse, 警告不再出现.
See: http://tech.karolzielinski.com/m2eclipse-eclipse-is-running-in-a-jre-but-a-jdk-is-required
<!-- .entry-content -->
This entry was posted in Java and tagged Eclipse, Java, JDK. Bookmark the permalink.
<!-- #post-## -->
WordPress插件: Post2Qzone 同步发表到QZone →
<!-- #nav-below -->
3 Responses to Eclipse is running in a JRE, but a JDK is required 解决方法
- Firm
- says: <!-- .comment-author .vcard -->
- October 7, 2010 at 15:47
- <!-- .comment-meta .commentmetadata -->
-
还真是麻烦。。。
- Reply
-
- xinba
- says: <!-- .comment-author .vcard -->
- July 5, 2011 at 10:10
- <!-- .comment-meta .commentmetadata -->
-
试了好半天,不管用,直接加参数,就好了
eclipse -vm c:\jdk1.4.2\jre\bin\javaw
- Reply
-
- flysnack
- says: <!-- .comment-author .vcard -->
- October 31, 2011 at 15:19
- <!-- .comment-meta .commentmetadata -->
-
根据注意事项3,把代码放到最前面后,配置成功。
- Reply
-
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Comment
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<!-- #container -->
- Search for: