-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
UnsupportedClassVersionError: Preview features seem to not be enabled in fallback despite passing --enable-preview to native-image #8097
Comments
What do you mean by fallback? Does Native Image generate a fallback image for your application? What error do you get when you build with |
Building with Even if that worked, I would still end up in
|
@fniephaus Sorry, I might have misinterpreted your comment, are you saying |
Ok, so this means that your app cannot be turned into a native image. Instead, a fallback image is created, which is essentially a thin launcher that runs your app on HotSpot. I'm not sure this is what you want?
When
According to this, I think you are right. |
My (unfounded) impression was that native-image would make a binary that had as much as possible as machine code, and then insert code to switch to executing on the JVM for some suitably selected part of the program. I realize the hand waving aspect of the terms "as much as possible" and "suitably selected". So you are right, a fallback image is not really what I want, and I wasn't expecting the "suitably selected" part of the program to be 100%. But being able to run Our build.gradle is fairly standard as far as I know, so my guess is that others who use preview (and incubator?) features could also be affected by this issue. |
We are working on some ideas that might allow to do this in the future, but currently, a fallback image simply calls out to HotSpot. Here's the relevant code in case you are interested: graal/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/FallbackExecutor.java Lines 46 to 55 in c069de7
Sure, that can very well be the case. We are still working on the Foreign Function & Memory API for Native Image. |
FYI, we just added #8113 for the FFM API in Native Image to the roadmap (in case you'd like to stay updated). |
Describe the issue
When passing
--enable-preview
to native-image, the fallback still seems to run without the parameter because I get an exception for faulty class versions, as shown in the logs below.The code being compiled is heavily reliant on reflection-like mechanisms for historical reasons.
Steps to reproduce the issue
On Linux with bash:
user@2f67272ea2e9:~/contiki-ng
)The display forwarding from docker to the host must work to reproduce the issue, headless mode takes completely different code paths.
Describe GraalVM and your environment:
More details
Excerpt from Gradle build output when passing
--info
:So native-image is invoked with
--enable-preview
. The log from running looks as expected, besides the "EDT thread call failed" and the exception:The text was updated successfully, but these errors were encountered: