eclipse-equinox / equinox

equinox
Eclipse Public License 2.0
31 stars 65 forks source link

Eclipse fails to launch after update with JRE 22.0.1: java.lang.NoSuchMethodError: getMainType #610

Closed kevinmilner closed 4 months ago

kevinmilner commented 4 months ago

First of all, apologies if this is the wrong place to report this issue; I'm happy to resubmit elsewhere. As it's a launching issue, I'm thinking it might be due to equinox, but I really don't understand the eclipse project structure well at all.

I'm running eclipse 2024-03 (4.31.0) on Ubuntu 24.04. I just updated via Oomph, which downloaded a new JRE: 22.0.1. Upon restarting (and all subsequent attempts), I can no longer launch eclipse. I get this error message in a GUI text window:

JVM terminated. Exit code=1
/home/kevin/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_22.0.1.v20240426-1149/jre/bin/java
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclientjava
-Dosgi.requiredJavaVersion=17
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Declipse.e4.inject.javax.warning=false
-Dsun.java.command=Eclipse
-Xms256m
-Xmx2048m
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Djava.security.manager=allow
-Declipse.p2.max.threads=10
-Doomph.update.url=https://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->https://raw.githubusercontent.com/eclipse-oomph/oomph/master/setups/
--add-opens=java.base/java.lang=ALL-UNNAMED
-jar /opt/eclipse/java-2024-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.700.v20240213-1244.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /home/kevin/.p2/pool/plugins/org.eclipse.epp.package.common_4.31.0.20240307-1200/splash.bmp
-launcher /opt/eclipse/java-2024-03/eclipse/eclipse
-name Eclipse
--launcher.library /home/kevin/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.900.v20240129-1338/eclipse_11900.so
-startup /opt/eclipse/java-2024-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.700.v20240213-1244.jar
--launcher.appendVmargs
-exitdata 2800d
-product org.eclipse.epp.package.java.product
-vm /home/kevin/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_22.0.1.v20240426-1149/jre/bin/java
-vmargs
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclientjava
-Dosgi.requiredJavaVersion=17
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
-Declipse.e4.inject.javax.warning=false
-Dsun.java.command=Eclipse
-Xms256m
-Xmx2048m
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Djava.security.manager=allow
-Declipse.p2.max.threads=10
-Doomph.update.url=https://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->https://raw.githubusercontent.com/eclipse-oomph/oomph/master/setups/
--add-opens=java.base/java.lang=ALL-UNNAMED
-jar /opt/eclipse/java-2024-03/eclipse//plugins/org.eclipse.equinox.launcher_1.6.700.v20240213-1244.jar 

And I see this if I launch it on a command line:

Exception in thread "main" java.lang.NoSuchMethodError: getMainType

I can manually launch eclipse by reverting to JRE 22.0.0 (rather than 22.0.1). There are no available updates when I do so.

iloveeclipse commented 4 months ago

@merks : something for you?

merks commented 4 months ago

A full stack trace would help.

It might well be the case that Java 22 breaks something that equinox needs to address. Java introducing breaking changes would not be a new thing.

kevinmilner commented 4 months ago

@merks do you know how to enable full stack traces when launching eclipse? All I get when launching is the exception message as pasted without the trace.

merks commented 4 months ago

It works for me on Windows:

image

merks commented 4 months ago

It also works on my old Ubuntu virtual box:

image

merks commented 4 months ago

Maybe running with -consoleLog will produce more output that includes a full stack trace. I can't find anything in Equinox or the Platform with a method name "getMainType", so that kind of odd.

If you create a new installation, does that also fail to start?

kevinmilner commented 4 months ago

Adding -consoleLog didn't give any extra information, but doing a clean install did seem to fix things. No clue what happened, but I'll close as I have it working now. Thanks for doing some digging on your end!

I did find that getMainType is in the JDT project. Maybe that package was corrupted during the update?