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
[Native Image] Error: java.lang.UnsupportedClassVersionError: Preview features are not enabled for com/MyService (class file version 67.65535). Try running with '--enable-preview'
#10647
Open
1 task done
patpatpat123 opened this issue
Feb 10, 2025
· 5 comments
Thank you, I was trying to reproduce the issue and running mvn -Pnative spring-boot:build-image but the build fails with
Exception in thread "main" java.lang.UnsupportedClassVersionError: Preview features are not enabled for com/example/enablepreviewissue/DummyController (class file version 67.65535). Try running with '--enable-preview'
...
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.4.2:process-aot (process-aot) on project enablepreviewissue: Process terminated with exit code: 1
Describe the Issue
Hello team,
I have a java 23 springboot 3 app, following Alina Yurenko tutorial
The thing is I am using preview features in my code. In my case, I am using structured task scope, which is a feature still in preview in Java 23.
With that said, I did configure the pom to enable preview features, but the build is still failing.
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
GraalVM 23 - VM 24.1.0 - aarch64
Operating System and Version
Reproducible with Mac Windowns and Linux
Build Command
mvn -Pnative spring-boot:build-image
Expected Behavior
I would have expected with all the enable preview used in the pom file (see above), the build would succeed.
Actual Behavior
Unfortunately, the build fails.
Steps to Reproduce
1 go to spring initializer to create a graalvm native project, as per Alina Yurenko's recommendations.
2 add a preview feature code, such as structured task scope.
3 run mvn -Pnative spring-boot:build-image
Additional Context
No response
Build Log Output and Error Messages
The text was updated successfully, but these errors were encountered: