Eclipse 返回错误消息“Java 已启动但返回退出代码= 1”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24408864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse returned error message “Java was started but returned exit code= 1”
提问by user2847749
Ok, so I had tried to install a new jdk / jre and suddenly my eclipse will not open. I have tried uninstalling old forms of java and reinstalling the java that I need, and it refuses to open. I've googled this and tried a dozen answers online but none of them work for me. It's extremely frustrating. ideas?
好的,所以我试图安装一个新的 jdk/jre,突然我的 eclipse 无法打开。我尝试卸载旧形式的 java 并重新安装我需要的 java,但它拒绝打开。我用谷歌搜索了这个并在网上尝试了十几个答案,但没有一个对我有用。这非常令人沮丧。想法?
采纳答案by user2847749
So I tried everything I could find for like 5 hours, and eventually came across this.... Open your eclipse.ini file. It will open in notebook. Mine is located here D:\eclipse_3.8.1\eclipse
所以我尝试了我能找到的所有东西,大约 5 个小时,最终遇到了这个......打开你的 eclipse.ini 文件。它将在笔记本中打开。我的位于这里 D:\eclipse_3.8.1\eclipse
The file starts out looking like this:
该文件开始看起来像这样:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms512m
-Xmx2G
Above -vmargs, add these two lines:
在 -vmargs 上方,添加以下两行:
-vm
location of your jdk javaw.exe file
so that it looks like this:
所以它看起来像这样:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120522-1813
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.6.0_45\bin\javaw.exe
-vmargs
-Xms512m
-Xmx2G
回答by Mind Peace
In your eclipse.ini file make sure you are pointing -vm to your jdk installation. You will get detail guidline in http://wiki.eclipse.org/Eclipse.ini#-vm_value%3a_Windows_Example
在您的 eclipse.ini 文件中,确保您将 -vm 指向您的 jdk 安装。您将在http://wiki.eclipse.org/Eclipse.ini#-vm_value%3a_Windows_Example 中获得详细指南