Eclipse 在启动时崩溃。eclipse.ini 错误?

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

Eclipse crashes on start-up. Wrong eclipse.ini?

eclipse

提问by Alexey Kalmykov

I'm really confused. I've worked with Eclipse IDE a lot and now I don't understand what's happening.

我真的很困惑。我经常使用 Eclipse IDE,现在我不明白发生了什么。

I've just downloaded latest Eclipse distributive and cannot start it. I'm getting the following message box before the IDE is even loaded:

我刚刚下载了最新的 Eclipse 发行版,但无法启动它。在加载 IDE 之前,我收到以下消息框:


---------------------------
Eclipse
---------------------------
JVM terminated. Exit code=-1
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Djava.class.path=D:\eclipse\plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
-os win32
-ws win32
-arch x86
-showsplash D:\eclipse\plugins\org.eclipse.platform_3.3.200.v200906111540\splash.bmp
-launcher D:\eclipse\eclipse.exe
-name Eclipse
--launcher.library D:\eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll
-startup D:\eclipse\plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
-product org.eclipse.epp.package.jee.product
-vm C:\Program Files\Java\jre6\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-Djava.class.path=D:\eclipse\plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar 
---------------------------
ОК   
---------------------------

I cannot find any additional logs. I haven't changed or modified anything. Just unzipped the archive.

我找不到任何其他日志。我没有改变或修改任何东西。刚刚解压存档。

Initially my eclipse.ini was:

最初我的 eclipse.ini 是:


-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

I thought that there is a problem with this newlines between name and value of the parameters. So I removed new lines (but according to thisit's actually a wrong move). So my eclipse.ini is now looks like this and I'm able to run it:

我认为参数名称和值之间的换行符有问题。所以我删除了新行(但根据this它实际上是一个错误的举动)。所以我的 eclipse.ini 现在看起来像这样,我可以运行它


-startup plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize 256M
-showsplash org.eclipse.platform
--launcher.XXMaxPermSize 256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

I googled for several hours. It seems only I have this problem. I believe Eclipse should work without these modifications of eclipse.ini (especially taking into account the fact they are incorrect). Any hints are much appreciated!

我用谷歌搜索了几个小时。好像只有我有这个问题。我相信 Eclipse 应该可以在没有 eclipse.ini 的这些修改的情况下工作(特别是考虑到它们不正确的事实)。任何提示都非常感谢!

PS: I'm running Vista, all firewalls and antiviral software is off.

PS:我运行的是 Vista,所有防火墙和防病毒软件都关闭了。

回答by JesperE

My guess is that you are running Vista 64-bit and trying to run a 32-bit Eclipse:

我的猜测是您正在运行 64 位 Vista 并尝试运行 32 位 Eclipse:

--launcher.library D:\eclipse\plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll

with a 64-bit JVM:

使用 64 位 JVM:

-vm C:\Program Files\Java\jre6\bin\client\jvm.dll

This will cause exactly your symptoms. The JVM will exit very early, since one of the very first things it tries to do is to load native code included in Eclipse.

这将导致您的症状。JVM 将很早就退出,因为它尝试做的第一件事就是加载 Eclipse 中包含的本机代码。

The solutionis to either install a 32-bit JVM (and make sure it is found before the 64-bit one in your PATH), or to use a 64-bit Eclipse.

解决方案是要么安装32位JVM(并确保它是64位的一个在PATH之前找到),或者使用一个64位的Eclipse。

回答by Andrew Niefer

The launcher parses each line as a separate argument, the new lines are required. After parsing,

启动器将每一行解析为一个单独的参数,新行是必需的。解析后,

{ "--launcher.XXMaxPermSize", "256M" }

is not the same as

不一样

{ "--launcher.XXMaxPermSize 256M" }

The first is recognized as an argument, the second isn't.

第一个被认为是一个论点,第二个不是。

After removing the new-lines from the .ini file, none of your arguments will be recognized and the launcher resorts to defaults. Since this works for you, this implies that one of your arguments in the original .ini is preventing it from starting.

从 .ini 文件中删除换行符后,您的任何参数都不会被识别,启动器将使用默认值。由于这对您有用,这意味着您在原始 .ini 中的一个论点阻止它启动。

The jvm exiting with -1 is a very early error, before running any eclipse java code so the problem shouldn't be the -startup, --launcher.library, -product or -showsplash. The -Xmx, -Xms and --launcher.XXMaxPermSize are the most likely candidates. Why is there two XXMaxPermSize? (though the launcher only passes one through, so I'm not sure that matters).

在运行任何 eclipse java 代码之前,以 -1 退出的 jvm 是一个非常早的错误,因此问题不应该是 -startup、--launcher.library、-product 或 -showsplash。-Xmx、-Xms 和 --launcher.XXMaxPermSize 是最有可能的候选对象。为什么有两个 XXMaxPermSize?(虽然发射器只通过一个,所以我不确定这很重要)。

回答by user1306828

For me Eclipse was hanging while starting up (showing splash page)

对我来说 Eclipse 在启动时挂起(显示启动页面)

This worked for me: Delete the .snapfile in the workspace. It is located in .metadata/.plugins/org.eclipse.core.resources

这对我有用:删除工作区中的.snap文件。它位于 .metadata/.plugins/org.eclipse.core.resources

This will bring all your projects that were in the workspace (No need to re-import)

这将带来工作区中的所有项目(无需重新导入)

回答by Dawann

I have merge your idea with those find at : http://www.eclipse.org/forums/index.php?t=msg&goto=653614&S=c78decc70e6fe52540e0e2c6f4c3076f#msg_653614

我已将您的想法与在以下位置找到的想法合并:http: //www.eclipse.org/forums/index.php?t=msg&goto=653614&S=c78decc70e6fe52540e0e2c6f4c3076f# msg_653614

And now my eclipse.ini file is :

现在我的 eclipse.ini 文件是:

-startup plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize 256M
-showsplash org.eclipse.platform
--launcher.XXMaxPermSize 256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:-UseCompressedOops

For the moment it seems to works

目前它似乎有效

回答by Nirav Sanghvi

One possible problem with your eclipse.ini file may be the jvm location, which can be the reason your eclipse didn't start. You can solve this by explicitly specifying the jvm in the -vm option after the "--launcher.XXMaxPermSize 256m" parameter.

eclipse.ini 文件的一个可能问题可能是 jvm 位置,这可能是 eclipse 未启动的原因。您可以通过在“--launcher.XXMaxPermSize 256m”参数后的 -vm 选项中显式指定 jvm 来解决此问题。

For e.g

例如

-vm  <your JVM path>

回答by VonC

Two suggestions:

两个建议:

1/ look at this eclipse.iniand try it out
2/ look for any extra space at the end of any line within the eclipse.ini: it can prevent eclipse starting normally.

1/ 看看这个eclipse.ini并尝试一下
2/ 在eclipse.ini 中任何一行的末尾寻找任何多余的空间:它可以防止eclipse 正常启动。

I do confirm there must be newlines between name and value of the parameters.

我确认参数的名称和值之间必须有换行符。

回答by peter.murray.rust

Have you been using a previous version of Eclipse? If so it's worth installing it in a completely different area (different workspace, etc.) Eclispe does seem to misbehave from time to time and the only solution is to reinstall. (I used to get strange errors in .metadata until I cleaned everything (after saving my code!) and reinstall.

您是否使用过以前版本的 Eclipse?如果是这样,值得将它安装在完全不同的区域(不同的工作区等)。Eclispe 似乎不时出现行为不端,唯一的解决方案是重新安装。(我曾经在 .metadata 中遇到奇怪的错误,直到我清理了所有内容(保存我的代码之后!)并重新安装。

回答by A Freelancer

I had exactly the same problem. The actual issue that i see here is with the double entry "launcher.XXMaxPermSize 256M ". Once you remove one of these, the settings seem to work fine with your original configuration

我遇到了完全相同的问题。我在这里看到的实际问题是双条目“launcher.XXMaxPermSize 256M”。删除其中之一后,这些设置似乎可以与您的原始配置一起正常工作

回答by ilu

I had this problem today. Solved by removing both "launcher.XXMaxPermSize 256M " lines from eclipse.ini file.

我今天遇到了这个问题。通过从 eclipse.ini 文件中删除“launcher.XXMaxPermSize 256M”两行来解决。

回答by gffny

I installed some plugins and restarted eclipse. It was failing on startup until I added

我安装了一些插件并重新启动了 eclipse。在我添加之前它在启动时失败

-vm C:\env\java\jdk\jdk1_7\bin\javaw.exe

-vm C:\env\java\jdk\jdk1_7\bin\javaw.exe

The eclipse installation was working fine before then

在此之前 eclipse 安装工作正常