You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Right now, if you configure a toolchain with a Java version (e.g. 21) that is higher than the version you run Gradle with (e.g. 17) you may get the following exception for Annotation Processor class files:
Caused by: java.lang.UnsupportedClassVersionError: ...AnnotationProcessor has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
at com.autonomousapps.tasks.FirstClassLoader.loadClass(FindDeclaredProcsTask.kt:390)
at com.autonomousapps.tasks.FindDeclaredProcsTask.procFor(FindDeclaredProcsTask.kt:129)
at com.autonomousapps.tasks.FindDeclaredProcsTask.procs(FindDeclaredProcsTask.kt:116)
at com.autonomousapps.tasks.FindDeclaredProcsTask.action(FindDeclaredProcsTask.kt:93)
The FindDeclaredProcsTask task works in the described setup and does not throw.
Describe alternatives you've considered
The solution is to run the build itself with a JDK that corresponds to the configured toolchain or is newer.
Additional context
Maybe this can be solved by using a worker action that runs in process isolation (?)
Or could the task be implemented without classloading (?)
Do you think this can be solved somehow @autonomousapps? If yes, I can attempt to provide a fix.
The text was updated successfully, but these errors were encountered:
jjohannes
changed the title
Make FindDeclaredProcsTask uses the JDK of the configured Java toolchain to load classes
Make FindDeclaredProcsTask use the JDK of the configured Java toolchain to load classes
Apr 15, 2024
I'm open to any solution to this problem that works and is maintainable. In the past, I considered trying to use a worker action with process isolation; actually I vaguely recall trying this and running into a major issue that felt like a bug in that API.
The reason I'm using a custom classloader here is that i need to "ask" the annotation processor which types it supports.
I think we have pretty good regression tests around this subject, so if you have time, feel free to experiment and see what solves your problem while also keeping the existing tests passing 👍
Is your feature request related to a problem? Please describe.
Right now, if you configure a toolchain with a Java version (e.g. 21) that is higher than the version you run Gradle with (e.g. 17) you may get the following exception for Annotation Processor class files:
https://scans.gradle.com/s/bcxd6sczjyfhk/failure#1
Describe the solution you'd like
The
FindDeclaredProcsTask
task works in the described setup and does not throw.Describe alternatives you've considered
The solution is to run the build itself with a JDK that corresponds to the configured toolchain or is newer.
Additional context
Do you think this can be solved somehow @autonomousapps? If yes, I can attempt to provide a fix.
The text was updated successfully, but these errors were encountered: