java - Eclipse 不运行

标签 java eclipse

您好,我尝试安装 eclipse,但我做错了什么,不久前我通过终端安装了 eclipse。只需点击 apt install eclipse 即可。我有 JDK 9 和 JRE 9。Eclipse 给我一个错误日志。

这是我的错误日志

eclipse.buildId=debbuild
java.version=9.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -os linux -ws gtk -arch x86_64

!ENTRY org.eclipse.equinox.simpleconfigurator 4 0 2018-03-02 16:41:15.343
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.simpleconfigurator_1.0.301.dist [1]" could not be resolved. Reason: Missing Constraint: Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,J2SE-1.4
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2018-03-02 16:41:15.351
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.simpleconfigurator_1.0.301.dist.jar was not resolved.

!ENTRY org.eclipse.osgi 2 0 2018-03-02 16:41:15.360
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2018-03-02 16:41:15.360
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.simpleconfigurator_1.0.301.dist.jar was not resolved.
!SUBENTRY 2 org.eclipse.equinox.simpleconfigurator 2 0 2018-03-02 16:41:15.360
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=CDC/Foundation)(version=1.1))(&(osgi.ee=JavaSE)(version=1.4)))".

!ENTRY org.eclipse.osgi 2 0 2018-03-02 16:41:15.362
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2018-03-02 16:41:15.362
!MESSAGE Bundle org.eclipse.equinox.simpleconfigurator_1.0.301.dist [1] was not resolved.
!SUBENTRY 2 org.eclipse.equinox.simpleconfigurator 2 0 2018-03-02 16:41:15.362
!MESSAGE Missing required capability Require-Capability: osgi.ee; filter="(|(&(osgi.ee=CDC/Foundation)(version=1.1))(&(osgi.ee=JavaSE)(version=1.4)))".

!ENTRY org.eclipse.osgi 4 0 2018-03-02 16:41:15.363
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    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 版本(根据插件 ID 判断可能是 3.8 或 4.2)非常旧,并且无法理解 Java 9。Java 9 JRE/JDK 目录的布局已发生显着变化,这是混淆了这个旧的 Eclipse。

使用 Eclipse Oxygen.2 4.7.2 与 Java 9 一起运行或使用 Java 8 运行旧版本的 Eclipse。

关于java - Eclipse 不运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49072716/

相关文章:

java - Mockito 方法调用链

Java Spring——在编译时识别语法错误(在 Eclipse 中)

java - 如何使用Jsoup通过ID查找元素?

android - 即使项目已清理,也缺少 R.java 文件

eclipse - 如何为 Eclipse Helios 添加版权?

java - 如何获取eclipse内部发出的完整 "java -cp xxxx com.xxx.class"命令?

java - 银行账户计划、余额变更

java - Android - 将屏幕转回关闭模式

Java循环对象声明最佳实践

java - 访问 CountDownTimer 封闭范围内的上下文