无法启动 CDT:java.lang.ClassNotFoundException:org.eclipse.core.runtime.adaptor.EclipseStarter

Cannot launch CDT: java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter

我正在尝试在 Ubuntu 18.04 LTS 下使用 Eclipse CDT。 我遇到了和其他许多人一样的错误,但我无法在阅读的内容中找到解决方案。

我尝试用

启动
$ eclipse &
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0

然后我得到

/home/user1/.eclipse/org.eclipse.platform_3.8_155965261/configuration/1551271296090.log

检查 /usr/lib/eclipse/configuration/config.ini 时(根据 this),我发现了以下几行(以及其他)

osgi.framework=file\:plugins/org.eclipse.osgi_3.8.1.dist.jar
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.301.dist.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info

至于前两行,我有文件

$ locate eclipse.osgi_
/usr/share/java/org.eclipse.osgi_3.8.1.dist.jar

$ locate simpleconfigurator_1
/usr/lib/eclipse/plugins/org.eclipse.equinox.simpleconfigurator_1.0.301.dist.jar

尽管如此:

  1. /usr/share/java/org.eclipse.osgi_3.8.1.dist.jar 似乎不属于任何包(一些旧包的残余?),因为

    $ apt-file search /usr/share/java/org.eclipse.osgi_3.8.1.dist.jar
    

    没有结果。

  2. 我有3.9.1版本

    $ dpkg -l | grep libequinox-osgi-java
    ii  libequinox-osgi-java                          3.9.1-1                               all          Equinox OSGi framework
    $ dpkg -L libequinox-osgi-java
    /.
    /usr
    /usr/share
    /usr/share/doc
    /usr/share/doc/libequinox-osgi-java
    /usr/share/doc/libequinox-osgi-java/changelog.Debian.gz
    /usr/share/doc/libequinox-osgi-java/copyright
    /usr/share/java
    /usr/share/java/org.eclipse.osgi-3.9.1.jar
    /usr/share/maven-repo
    /usr/share/maven-repo/org
    /usr/share/maven-repo/org/eclipse
    /usr/share/maven-repo/org/eclipse/osgi
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/3.9.1
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/3.9.1/org.eclipse.osgi-3.9.1.pom
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/debian
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/debian/org.eclipse.osgi-debian.pom
    /usr/share/java/org.eclipse.osgi.jar
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/3.9.1/org.eclipse.osgi-3.9.1.jar
    /usr/share/maven-repo/org/eclipse/osgi/org.eclipse.osgi/debian/org.eclipse.osgi-debian.jar
    

所以不知道是不是这里的问题

我该如何解决?

无法在此处找到答案

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891956

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898086

https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/1754886

https://ubuntu.pkgs.org/16.04/ubuntu-universe-i386/libequinox-osgi-java_3.8.1-8_all.deb.html

https://askubuntu.com/questions/1031171/eclipse-doesnt-start-on-ubuntu-18-04

您可能使用的是 旧版 Eclipse,它不适用于 Java 9 或更高版本:

If using Java 9 or newer please use Eclipse 4.7.1a or newer as it contains fixes in Eclipse launcher to add all JVM modules.

执行以下操作之一来解决问题: