如何在 Ubuntu 17.10 下启动 Eclipse Neon/Oxygen?

How can I start Eclipse Neon/Oxygen under Ubuntu 17.10?

我使用 Ubuntu 17.10 和

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

自从我从 17.04 升级到 17.04 后,我无法启动 eclipse。它总是抛出异常:

!SESSION 2017-12-10 21:39:32.982
-----------------------------------------------
eclipse.buildId=4.6.3.M20170301-0400
java.version=1.8.0_151
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product
org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.osgi 4 0 2017-12-10 21:39:36.095
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4559)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:958)
at org.eclipse.swt.widgets.Display.create(Display.java:942)
at org.eclipse.swt.graphics.Device.<init>(Device.java:174)
at org.eclipse.swt.widgets.Display.<init>(Display.java:562)
at org.eclipse.swt.widgets.Display.<init>(Display.java:553)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:795)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:160)
at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:168)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:111)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

我尝试使用现有的和新鲜的 Eclipse Neon 和 Eclipse Oxygen。我也试过

--launcher.GTK_version
2

在eclipse.ini和

export SWT_GTK3=0

开始前在控制台中

./eclipse

我不知道我能做些什么来解决这个问题。

在较旧的 Ubuntu 版本上,GTK3=0 的技巧效果很好,但现在不行。你有什么想法吗?

我纠正一下。我已经在 Ubuntu 17.10.

下尝试使用 Oxygen.1a

我找到了原因,但不是没有真正理解。当我从控制台以 "root" 启动 eclipse 时,会出现问题 "only"。如果我不使用 sudo 启动 eclipse,一切正常,eclipse 不会崩溃。

自从这个组合(Ubuntu 17.10,Eclipse Neon/Oxygen)我没有遇到这个问题。因为我使用了一个复杂的网络应用程序和一个 tomcat-web 服务器,它是从 eclipse 部署和启动的,所以以 root 身份做开发中的所有事情都更容易。

所以我需要改变我的行为来获得一切运行。

那么这个话题就解决了。