Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 23 support #17564

Closed
TheDGOfficial opened this issue Sep 24, 2024 · 6 comments
Closed

Java 23 support #17564

TheDGOfficial opened this issue Sep 24, 2024 · 6 comments
Labels
question Further information is requested

Comments

@TheDGOfficial
Copy link

Description of the issue

Since Java 22 works fine and is a non-LTS version, I presume CodeQL aims to support all Java versions, not just LTS. Currently, Java 23 gradle project gives this error:

The error (long)
java.lang.IllegalArgumentException: Unsupported class file major version 67
	at com.semmle.org.objectweb.asm.ClassReader.<init>(ClassReader.java:200)
	at com.semmle.org.objectweb.asm.ClassReader.<init>(ClassReader.java:180)
	at com.semmle.org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
	at com.semmle.extractor.java.InterceptingAgent.transform(InterceptingAgent.java:275)
	at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:242)
	at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:610)
	at java.base/java.lang.ApplicationShutdownHooks.<clinit>(ApplicationShutdownHooks.java:43)
	at java.base/java.lang.Runtime.addShutdownHook(Runtime.java:250)
	at java.logging/java.util.logging.LogManager.<init>(LogManager.java:300)
	at java.logging/java.util.logging.LogManager.<init>(LogManager.java:293)
	at java.logging/java.util.logging.LogManager$1.run(LogManager.java:248)
	at java.logging/java.util.logging.LogManager$1.run(LogManager.java:223)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
	at java.logging/java.util.logging.LogManager.<clinit>(LogManager.java:222)
	at java.logging/java.util.logging.Logger.demandLogger(Logger.java:650)
	at java.logging/java.util.logging.Logger.getLogger(Logger.java:720)
	at java.logging/java.util.logging.Logger.getLogger(Logger.java:703)
	at org.gradle.internal.logging.source.JavaUtilLoggingSystem.<init>(JavaUtilLoggingSystem.java:55)
	at org.gradle.internal.logging.services.LoggingServiceRegistry.createLoggingManagerFactory(LoggingServiceRegistry.java:155)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
	at org.gradle.internal.service.ReflectionBasedServiceMethod.invoke(ReflectionBasedServiceMethod.java:35)
	at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:1057)
	at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.createServiceInstance(DefaultServiceRegistry.java:959)
	at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.createServiceInstance(DefaultServiceRegistry.java:1077)
	at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectServiceProvider.getInstance(DefaultServiceRegistry.java:686)
	at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:771)
	at org.gradle.internal.service.DefaultServiceRegistry.find(DefaultServiceRegistry.java:356)
	at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:340)
	at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:335)
	at org.gradle.internal.logging.services.LoggingServiceRegistry.newCommandLineProcessLogging(LoggingServiceRegistry.java:82)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory.createLoggingServices(DefaultCommandLineActionFactory.java:127)
	at org.gradle.launcher.cli.DefaultCommandLineActionFactory.convert(DefaultCommandLineActionFactory.java:82)
	at org.gradle.launcher.Main.doAction(Main.java:35)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:52)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:72)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:39)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:70)

I don't know if any of the rules need to be changed or any new rules need to be added for the new language version, but it's likely that just updating the bundled ASM version will fix the error and make it work, and I presume that should be enough.

I use the codeql action to run codeql, please let me know if I opened the issue on the wrong place.

@TheDGOfficial TheDGOfficial added the question Further information is requested label Sep 24, 2024
@smowton
Copy link
Contributor

smowton commented Sep 24, 2024

Yes, we do. Apologies that we're a little behind. I anticipate CodeQL 2.19.1 (probable release date Thursday 3rd October) will support this version.

@danishnawab
Copy link

@smowton it would be great if future Java releases could be supported by CodeQL on day 1.
This is the direction most Java vendors are moving toward.
The OpenJDK release candidates (available ~1 month before the GA release) can be used to build and test against.

@smowton
Copy link
Contributor

smowton commented Sep 25, 2024

Yes, that's our usual practice. I'm just behind. Sorry, be there very soon!

@danishnawab
Copy link

Thank you for your efforts 🫡

@smowton
Copy link
Contributor

smowton commented Sep 27, 2024

This will be supported as expected in 2.19.1. Note that as per usual, CodeQL does not support preview or incubator language features.

@danishnawab
Copy link

@smowton was the Java 23 support released in 2.19.1? It still does not work for my projects as expected.
Please see #17681 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants