3

Today I tried to start Eclipse on Ubuntu 16.04 and get the following error:

/opt/eclipse-neon-manual/eclipse
java.lang.ExceptionInInitializerError
    at org.eclipse.osgi.storage.Storage.<init>(Storage.java:100)
    at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:87)
    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:538)
    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 @67e2d983
    at java.base/jdk.internal.reflect.Reflection.throwInaccessibleObjectException(Reflection.java:427)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:201)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:186)
    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
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

How to fix this?

Thorsten Niehues
  • 1,277
  • 5
  • 17
  • 32

2 Answers2

1

I have an Ubuntu 64-bit system.

I had that error message when I tried to install Eclipse with Java 9 installed on my system.

I switched from Java 9 to Java 8 and Eclipse Neon installed just fine.

Here is how you switch Java versions= https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

Gene
  • 111
  • The method in the linked article only switches java to a different version. All the other executables of the java-package won't. See here: http://askubuntu.com/questions/315646/update-java-alternatives-vs-update-alternatives-config-java – MadMike Mar 16 '17 at 09:55
  • 1
    I prefer to install Java 8 with this method: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html – MadMike Mar 16 '17 at 09:56
0

Download the most recent Eclipse to fix the issue.

In my case I downloaded Eclipse Neon 2.

After that eclipse starts fine again.

Thorsten Niehues
  • 1,277
  • 5
  • 17
  • 32