-
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
[native-image] Using java.util.prefs currently not supported for native-image generation #2063
Comments
I think this is a duplicate of gluonhq/substrate#237. The Preferences API was missing from in SubstrateVM. This has been fixed in the latest build as noted in above issue. However, I still get a linker error for which I have opened another issue: gluonhq/substrate#260. |
Getting identical behaviour on 19.3.1; updating the attached log and renaming the issue |
@xzel23 how did you manage to verify that those changes worked? Do you have any clues on how to build SubstrateVM (native-image in particular) from source yourself? Couldn't find any info on actual building. Also I don't quite understand the relationship between Oracle's native-image/SubstrateVM and Gluon's "substrate", I guess the latter one is a fork |
@fomalsd First of all I use the Gluon client plugin for building. It makes it easier to create native images by offering a maven task. It downloads a copy of substrateVM to your system that's used later on. When I started, I had the exact same error messages that you have here. I used verbose output to see the linker flags, then tried to locate the libraries that were being linked. Using In the meantime, a new version (0.0.4) of the plugin has been released that pulls in a substrate version that fixes this issue, so I use that one. Since you are not using the plugin, you could either give it a try, or try building your own version. You can see the linker flags that added the preferences API in this commit: gluonhq/substrate@7cf89b0. I am also not 100% sure about the exact relationship between gluon and Graal, but I think they use substrate as a base and build their substrateVM on top of that is able to run JavaFX applications. Not everything is supported yet, i.e. I am currently stuck at javafx.web and javafx.media, but it's advancing steadily. |
Any news? It appears that fix is as trivial as this: |
ATM, we don't have any explicit support for JVM libprefs library ( |
Not really, I'm just trying to convert a jar of marytts: Searching through their repository did not reveal any prefs-related code. |
Still experiencing this issue with GraalVM 20.0. See https://github.com/sbrannen/graalvm-playground/tree/master/preferences
Note, however, that |
pinging on this. |
Running into the same issue here. Even tried copying the class and building it into my project and it still fails. I can build some native-images for really basic projects but there's some dependency that lots of larger projects use that ends up triggering this. |
Just updated to 20.1 and still getting the same issue. My log output looks like this:
|
hey, my error seems to be the same, although it's not on MAC, but on Linux, and I've updated to the 20.1.0 but still get the error, because of multiple dependency jar's that I use depend on java.util.preferences.*
any help would be appreciated. |
Hey everyone! If you are not running on Darwin + JDK 8, give this a shot and post a comment of how it goes. @fomalsd, as you were hitting this issue on Darwin + JDK 8, I will post an update once we build the missing library. Note: this will not be in the 20.2 release, so the only way to test it would be by building Graal from the master branch Edit: It seems like a nightly build with the patch included is now available at https://github.com/graalvm/graalvm-ce-dev-builds/releases, you can also download it from there and try it out |
I can confirm that GraalVM CE 20.3.0-dev-20200912_0211 (graalvm-ce-java11-linux-amd64-dev) fixed the issue for me at least. With 20.2.0 for the same arch, I was getting linker errors with undefined references to |
@t3rmian Thank you for checking this out, I'm glad that it solved it! |
@gradinac kindly fixed this on master. |
Native image compiler crashes on macOS 10.14.6 after
write:
stageReproduction:
marytts-runtime-compact.jar.zip – unzip first
Compile with:
/graalvm-ce-java8-19.3.1/Contents/Home/bin/native-image --no-fallback --allow-incomplete-classpath --report-unsupported-elements-at-runtime -jar /marytts-runtime-compact.jar
The text was updated successfully, but these errors were encountered: