您的位置:首页 > 编程语言 > Java开发

eclipse 错误 java was started but returned exit code =-805306369

2011-12-06 17:22 519 查看
java was started but returned exit code =-805306369

这个错误原因可能有很多,我这只是一只可能的解决方法,如下:

主要原因是eclipse.ini配置文件错误了,配置文件中-vm参数设置错误,在windows7系统下需要使用
" / " 而不是 " \ "

原配置文件:

-startup

plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_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
-vm

C:\soft\Java\jdk1.6.0_25\bin\javaw.exe


--launcher.defaultAction

openFile

-vmargs

-Dosgi.requiredJavaVersion=1.5

-Xms40m

-Xmx512m

修改后的配置文件:

-startup

plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_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
-vm

C:/soft/Java/jdk1.6.0_25/bin/javaw.exe


--launcher.defaultAction

openFile

-vmargs

-Dosgi.requiredJavaVersion=1.5

-Xms40m

-Xmx512m

参考文献:

Eclipse出现java was started but returned exit code 1报错并退出

最近在使用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参数的注意事项:

(1)The -vm option and its value (the path) must be on separate lines.(-vm选项和其对应的javaw.exe的路径必须各占一行,这应该是参数解析的格式要求)

(2)The value must be the full absolute path to the Java executable, not just to the Java home directory.(指定的虚拟机路径必须是指向可执行Java程序的完整绝对路径,不能只指定到Java_HOME目录。这个好理解,要指定JVM的话肯定要指定到具体的可执行文件去)

(3)The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.(-vm选项必须放在-vmargs选项前,这是因为-vmargs选项后的值都是作为JVM的参数传给虚拟机的,如果-vm放在-vmargs之后就没有意义了。而-vmargs选项中一般可指定-Xms和-Xmx这两个内存参数)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐