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
The current processAot task does not utilize the gradle toolchain, and it will fail if the Java environment version is lower than the toolchain language version. In my project settings, I have defined the Java language version as 21 using the following configuration:
However, my Java environment is using Java 17. When I run gradle build, it fails with the following error:
Task :processAot FAILED
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/oldshensheep/Main 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 java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:70)
Execution failed for task ':processAot'.
> Process 'command 'E:\apps\scoop\apps\temurin-lts-jdk\current\bin\java.exe'' finished with non-zero exit value 1
I've found similar issues, but it is not the case:
The current
processAot
task does not utilize the gradle toolchain, and it will fail if the Java environment version is lower than the toolchain language version. In my project settings, I have defined the Java language version as 21 using the following configuration:However, my Java environment is using Java 17. When I run
gradle build
, it fails with the following error:I've found similar issues, but it is not the case:
spring-io/initializr#1187
#33365
The text was updated successfully, but these errors were encountered: