我刚刚从 14.04 LTS 升级到 16.04,突然 Eclipse 无法启动。这是 Eclipse 日志文件:
!SESSION 2016-08-28 19:43:46.941 -----------------------------------------------
eclipse.buildId=debbuild
java.version=1.8.0_91
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 2 0 2016-08-28 19:43:47.899
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2016-08-28 19:43:47.899
!MESSAGE Bundle reference:file:plugins/org.eclipse.compare.core_3.5.200.dist.jar was not resolved.
!SUBENTRY 2 org.eclipse.compare.core 2 0 2016-08-28 19:43:47.899
!MESSAGE Missing imported package com.ibm.icu.text_3.6.1.
!SUBENTRY 2 org.eclipse.compare.core 2 0 2016-08-28 19:43:47.899
!MESSAGE Missing imported package com.ibm.icu.util_3.6.1.
!SUBENTRY 1 org.eclipse.osgi 2 0 2016-08-28 19:43:47.899
!MESSAGE Bundle reference:file:plugins/org.eclipse.ui.workbench_3.8.1.dist.jar was not resolved.
!SUBENTRY 2 org.eclipse.ui.workbench 2 0 2016-08-28 19:43:47.899
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=JavaSE)(version=1.4))(&(osgi.ee=CDC/Foundation)(version=1.1)))".
!SUBENTRY 1 org.eclipse.osgi 2 0 2016-08-28 19:43:47.900
... 稍后会出现几页类似的日志错误消息......
!ENTRY org.eclipse.osgi 4 0 2016-08-28 19:43:48.011
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "org.eclipse.ui.ide.workbench" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.equinox.app.error, org.eclipse.equinox.p2.director, org.eclipse.equinox.p2.garbagecollector.application, org.eclipse.equinox.p2.publisher.InstallPublisher, org.eclipse.equinox.p2.publisher.EclipseGenerator, org.eclipse.equinox.p2.publisher.ProductPublisher, org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher, org.eclipse.equinox.p2.reconciler.application, org.eclipse.equinox.p2.repository.repo2runnable, org.eclipse.equinox.p2.repository.metadataverifier, org.eclipse.equinox.p2.artifact.repository.mirrorApplication, org.eclipse.equinox.p2.metadata.repository.mirrorApplication, org.eclipse.equinox.p2.updatesite.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.UpdateSitePublisher, org.eclipse.equinox.p2.publisher.CategoryPublisher, org.eclipse.update.core.standaloneUpdate, org.eclipse.update.core.siteOptimizer, org.eclipse.pde.build.Build, org.eclipse.pde.junit.runtime.uitestapplication, org.eclipse.pde.junit.runtime.legacytestapplication, org.eclipse.pde.junit.runtime.coretestapplication, org.eclipse.pde.junit.runtime.coretestapplicationnonmain, org.eclipse.pde.junit.runtime.nonuithreadtestapplication, org.eclipse.jdt.core.JavaCodeFormatter, org.eclipse.jdt.core.JavaIndexer, org.eclipse.jdt.apt.core.aptBuild.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
还有人遇到过这种情况吗?
编辑:升级到 Eclipse 4.2给出此错误:
JVM terminated. Exit code=13
/usr/bin/java
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar /home/_____/eclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
-os linux
-ws gtk
-arch x86
-showsplash /home/_____/eclipse/eclipse//plugins/org.eclipse.platform_4.2.0.v201206081400/splash.bmp
-launcher /home/_____/eclipse/eclipse/eclipse
-name Eclipse
--launcher.library /home/_____/eclipse/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120522-1813/eclipse_1502.so
-startup /home/_____/eclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 18800a
-vm /usr/bin/java
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar /home/_____/eclipse/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
似乎缺少一堆依赖项:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120913-144807/eclipse_1502.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Gtk-Message: Failed to load module "overlay-scrollbar"
Gtk-Message: Failed to load module "unity-gtk-module"
(Eclipse:17614): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
我跑了
sudo apt-get install unity-gtk-module-common:i386
但收到此消息:
Note, selecting 'unity-gtk-module-common' instead of 'unity-gtk-module-common:i386'
unity-gtk-module-common is already the newest version (0.0.0+15.04.20150118-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
尝试安装 overlay-scrollbar 只会提示它已经是最新版本。尝试 overlay-scrollbar:i386 会显示以下消息:
Package overlay-scrollbar:i386 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
我也尝试使用降级 Java 到 1.7 sudo update-java-alternatives
,但这也不能消除初始错误
答案1
是的。就是这样。Eclipse 3.8 似乎无法与 Java 8 配合使用。因此,如果您需要使用 Java 8,则需要安装 eclipse 4.2 (Luna)。我更喜欢使用 Oracle Java 而不是 Open JDK。继续使用 eclipse 4.2 和 Oracle Java 8。
答案2
好吧,我建议您安装 Oracle JDK 8 64 位并从官方网站下载 Eclipse 4.2 64 位 tar 文件并解压缩,然后双击 eclipse 可执行文件。