eclipse JVM 终止。退出代码 = -1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4861380/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:54:53  来源:igfitidea点击:

JVM terminated. Exit code = -1

eclipsejvm

提问by Lex

I've been using Eclipse for some time already, and I didn't have any problems with it. However, when I tried to generate some javadoc, I found that I didn't have the SDK installed. I installed jdk 6u23, and from then on, Eclipse hasn't been working.

我已经使用 Eclipse 一段时间了,我没有遇到任何问题。但是,当我尝试生成一些 javadoc 时,我发现我没有安装 SDK。我安装了jdk 6u23,从那以后,Eclipse 一直没有工作。

At first it told me it couldn't find a JRE/SDK. After copying and placing the JRE in the Eclipse folder, the error changed to this:

起初它告诉我它找不到 JRE/SDK。将JRE复制并放入Eclipse文件夹后,错误变成了这样:

http://i258.photobucket.com/albums/hh261/magical_7/Eclipse.png

http://i258.photobucket.com/albums/hh261/magical_7/Eclipse.png

I've searched around for some solutions, and found a few of varying nature. However, none of them seemed to work. I've tried emptying my eclipse.ini file without success. Altering some values in eclipse.ini didn't work either. Installing Java SDK 1.5 didn't work.

我搜索了一些解决方案,并找到了一些性质不同的解决方案。然而,它们似乎都不起作用。我尝试清空我的 eclipse.ini 文件但没有成功。更改 eclipse.ini 中的某些值也不起作用。安装 Java SDK 1.5 不起作用。

Does anyone have other possible solutions?

有没有人有其他可能的解决方案?

Update: I tried reinstalling Eclipse, but it didn't fix the problem. I did notice that it's a 32bit version, while I'm running a 64bit system. However, if this were to be the problem, I find it strange that it hasn't been an issue earlier.

更新:我尝试重新安装 Eclipse,但没有解决问题。我确实注意到它是 32 位版本,而我运行的是 64 位系统。但是,如果这是问题所在,我觉得很奇怪,之前没有出现过问题。

Update 2I've reinstalled both Eclipse and Java once more, and everything works again.

更新 2我再次重新安装了 Eclipse 和 Java,一切又恢复了。

回答by Shashank Kadne

Remove the default value "256m/256M" from the eclipse configuration file (eclipse.ini).

从 eclipse 配置文件 (eclipse.ini) 中删除默认值“256m/256M”。

You will find this line just below "--launcher.XXMaxPermSize".

您会在“--launcher.XXMaxPermSize”下方找到这一行。

回答by Zaw Htet Han

Edit your Environment Variables >> System Variables >> Path to

编辑您的环境变量 >> 系统变量 >> 路径

C:\Program Files (x86)\Java\jdk1.6.0_24\bin;

C:\Program Files (x86)\Java\jdk1.6.0_24\bin;

(NOT C:\Program Files\Java\jdk1.7.0_01\bin;)

(不是 C:\Program Files\Java\jdk1.7.0_01\bin;)

it should work

它应该工作

回答by Chan.Android

If you have got a problem like that, you should change the path of jre.

如果你有这样的问题,你应该改变jre的路径。

Firstly, computer> properties > advance system setting > Environment variables > find "path" under system variables then give the directory of your jre/bin. (for example C:\ Program Files\ java\ jre\ bin)

首先,计算机>属性>高级系统设置>环境变量>在系统变量下找到“路径”,然后给出你的jre/bin目录。(例如C:\ Program Files\ java\ jre\ bin

回答by Raghuram

Perhaps you should reinstallEclipse. Then you can add the JDK through Windows -> Preferences -> Java -> Installed JREs.

也许你应该reinstallEclipse。然后你可以通过 Windows -> Preferences -> Java -> Installed JREs 添加 JDK。

回答by blissfool

I had similar issue: Eclipse IDE fail to launch with JVM Terminated. Exit code=-1

我有类似的问题: Eclipse IDE 无法在 JVM 终止的情况下启动。退出代码=-1

One thing that worked for me is to set -Xmx to 256m in eclipse.ini. If that is not good enough for you, you may also try using different JVM module than the one that eclipse uses by default.

对我有用的一件事是在 eclipse.ini 中将 -Xmx 设置为 256m。如果这对您来说还不够好,您也可以尝试使用与 eclipse 默认使用的模块不同的 JVM 模块。

If you look in the error dialog in your screen capture, you'll notice that the "-vm" option using "jvm.dll" as JVM. If you change it to use javaw.exe in your JAVA_HOME\bin folder, the problem should go away.

如果您查看屏幕截图中的错误对话框,您会注意到“-vm”选项使用“jvm.dll”作为 JVM。如果您将其更改为在 JAVA_HOME\bin 文件夹中使用 javaw.exe,则问题应该会消失。

I'm still clueless as to what the difference is between using jvm.dll vs javaw.exe. Maybe jvm.dll is suppose to be used only for light-weight embedded java applet and it can't handle the load brought on by a full stand-alone Java UI software.

我仍然不知道使用 jvm.dll 与 javaw.exe 之间的区别是什么。也许 jvm.dll 被认为只用于轻量级的嵌入式 Java 小程序,它无法处理完整的独立 Java UI 软件带来的负载。

回答by Irik

I just had the same problem on Windows 7, 64 bit. I reinstalled Java 32 and Java 64, and Eclipse, but it did not fix the problem. I found that in eclipse.ini the Dosgi.requiredJavaVersionwas 1.5, so I changed it to Dosgi.requiredJavaVersion=1.6.0_25. In the Environmental variables I added to the PATH %JAVA_HOME%\bin;C:\Program Files (x86)\Java\jdk1.6.0_25\bin. These changes fixed my Eclipse problem.

我刚刚在 64 位 Windows 7 上遇到了同样的问题。我重新安装了 Java 32 和 Java 64 以及 Eclipse,但没有解决问题。我发现在 eclipse.ini 中Dosgi.requiredJavaVersion是 1.5,所以我把它改成了Dosgi.requiredJavaVersion=1.6.0_25. 在我添加到 PATH 的环境变量中%JAVA_HOME%\bin;C:\Program Files (x86)\Java\jdk1.6.0_25\bin。这些更改修复了我的 Eclipse 问题。

回答by andro

In my case the cause was a corrupted eclipse.inifile. I had been editing the file, and accidentally changed -Xmx512mto -Xmx512

就我而言,原因是eclipse.ini文件损坏。我一直在编辑文件,不小心改成-Xmx512m-Xmx512

回答by Ajit Singh

First Approach:

第一种方法:

  1. I added below lines in eclipse.ini

    -vm C:\Program Files(x86)\Java\jre\bin\java.exe
    
  2. Modified below line in eclipse.ini(changed to 1.6.0_37from 1.5),

    -Dosgi.requiredJavaVersion=1.6.0_37
    
  3. Deleted JAVA_HOMEfrom environment variables which was pointing to c:\jdk1.6

  1. 我在下面添加了几行 eclipse.ini

    -vm C:\Program Files(x86)\Java\jre\bin\java.exe
    
  2. 修改下面的行eclipse.ini(改为1.6.0_37from 1.5),

    -Dosgi.requiredJavaVersion=1.6.0_37
    
  3. JAVA_HOME从指向的环境变量中删除c:\jdk1.6

Now Eclipse is working fine.

现在 Eclipse 工作正常。

Second Approach:

第二种方法:

Another way - don't add below line in Eclipse and only modify JAVA_HOMEto point to C:\Program Files(x86)\Java\jre,

另一种方法 - 不要在 Eclipse 中添加以下行,只修改JAVA_HOME指向C:\Program Files(x86)\Java\jre

-vm C:\Program Files(x86)\Java\jre\bin\java.exe

Eclipse should work now.

Eclipse 现在应该可以工作了。

回答by user2552831

I added the entry in the Pathenvironment variable to the jdk bin folder and it started working

我将Path环境变量中的条目添加到 jdk bin 文件夹中,它开始工作

Path = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Application Virtualization Client;C:\Program Files\Java\jdk1.6.0_18\bin

回答by Vivek Vermani

There could be many possible causes for this error. It could be that compatible mode is not selected in windows 7 , path or eclipse.ini problem.

此错误可能有许多可能的原因。可能是在 windows 7 中没有选择兼容模式,路径或 eclipse.ini 问题。