![无法在 Ubuntu 16.04 中安装 Eclipse](https://linux22.com/image/1145820/%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%2016.04%20%E4%B8%AD%E5%AE%89%E8%A3%85%20Eclipse.png)
我是 Ubuntu 新手。目前我使用的是 Ubuntu 16.04,我想安装 Eclipse
我已按照本文档中提到的步骤进行操作 http://ubuntuhandbook.org/index.php/2016/01/how-to-install-the-latest-eclipse-in-ubuntu-16-04-15-10/
但在第三步我收到以下错误
通过终端检查错误后,我得到以下信息
shiv@shiv-HP-Notebook:~/Softwares/Eclipse/eclipse-installer$ ./eclipse-inst
java.lang.ExceptionInInitializerError
at org.eclipse.osgi.storage.Storage.<init>(Storage.java:101)
at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:88)
at org.eclipse.osgi.internal.framework.EquinoxContainer.<init> (EquinoxContainer.java:66)
at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:303)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:239)
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:547)
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)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @b9afc07
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:335)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:278)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:196)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:190)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:51)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findMethod(FrameworkExtensionInstaller.java:58)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.findAddURLMethod(FrameworkExtensionInstaller.java:42)
at org.eclipse.osgi.storage.FrameworkExtensionInstaller.<clinit>(FrameworkExtensionInstaller.java:36)
... 14 more
有人能告诉我我哪里犯了错误吗?谢谢
*****************************更新************************************
我尝试用新的方式安装。
sudo apt-get update
sudo apt-get install eclipse
当我尝试启动它时,对话框中出现以下错误
An error has occurred. See the log file
/home/shiv/.eclipse/org.eclipse.platform_3.8_155965261/configuration/1488271982409.log.
以下是日志文件的详细信息
!SESSION 2017-02-28 14:16:16.279 -----------------------------------------------
eclipse.buildId=debbuild
java.version=9-ea
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN
Command-line arguments: -os linux -ws gtk -arch x86_64 -clean -initialize
!ENTRY org.eclipse.osgi 4 0 2017-02-28 14:16:16.693
!MESSAGE error loading hook: org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator
!STACK 0
java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.net.URLClassLoader.addURL(java.net.URL) accessible: module java.base does not "opens java.net" to unnamed module @402a079c
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:335)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:278)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:196)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:190)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:174)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findMethod(BaseStorage.java:181)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.findAddURLMethod(BaseStorage.java:165)
at org.eclipse.osgi.internal.baseadaptor.BaseStorage.<init>(BaseStorage.java:135)
at org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator.addHooks(BaseHookConfigurator.java:24)
at org.eclipse.osgi.baseadaptor.HookRegistry.loadConfigurators(HookRegistry.java:178)
at org.eclipse.osgi.baseadaptor.HookRegistry.initialize(HookRegistry.java:100)
at org.eclipse.osgi.baseadaptor.BaseAdaptor.<init>(BaseAdaptor.java:98)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:473)
at org.eclipse.core.runtime.adaptor.EclipseStarter.createAdaptor(EclipseStarter.java:737)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:258)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
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:547)
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)
!ENTRY org.eclipse.osgi 4 0 2017-02-28 14:16:16.795
!MESSAGE Startup error
!STACK 1
java.lang.NullPointerException
at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123)
at org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:192)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:262)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
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:547)
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)
答案1
答案2
我找到了一个临时解决方案。如果我将 Java 更改为版本 8,一切都会正常。之前我尝试使用版本 9,发现了这些错误