最近在使用Eclipse时发现无法启动,或者启动后经常出现崩溃退出的情况,提示的错误信息都是“
java was started but returned exit code 1”,下载安装了最新版的Eclipse后还是没有解决问题。无奈之下只好百度之,翻了好几页都没有发现有用的信息,直接换到Google.com,终于在Eclipse Forum找到了一个靠谱的答案(网址是
http://www.eclipse.org/forums/index.php?t=tree&goto=547573&#page_top),回答答案是“Eclipse is using the system default JRE that it finds in the windows system folders. You should point it to a JDK installation using eclipse.ini (as described here: http://wiki.eclipse.org/Eclipse.ini )”,大意是Eclipse启动的时候默认会使用从windows系统目录下找到的JRE作为默认的环境,由于我之前升级安装了一下JDK,所以系统目录下的JRE和实际的
Java安装是不匹配的,因此会出现运行Eclipse时报错的情况。
解决方案: 根据eclipse.ini文件的说明( http://wiki.eclipse.org/Eclipse.ini),该文件提供指定运行eclipse的JVM功能,需要在eclipse.ini中加入JVM的路径说明。语法很简单: -vm C:\Program Files\Java\jdk1.6.0_22\bin\javaw.exe
eclipse.ini说明文档中特别提到使用-vm参数的注意事项: |
打开eclipse出错的很好解决方法转java was started but returned exit code=1
最新推荐文章于 2023-10-27 20:35:01 发布