Skip to content
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

java.lang.NoClassDefFoundError: Ljava/nio/ByteBuffer - when running a JavaFX app #41

Open
makingthematrix opened this issue Nov 13, 2021 · 1 comment

Comments

@makingthematrix
Copy link

Describe the bug

If I build a native image with JavaFX and try to run it, an error crashes the app at initialization:

Exception in thread "main" java.lang.RuntimeException: java.lang.NoClassDefFoundError: Ljava/nio/ByteBuffer;
  | => nat com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:290)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:288)
...

To Reproduce Steps to reproduce the behavior:

I prepared a minimal example and put the steps to reproduce the error in the description:
https://github.com/makingthematrix/javafx_sbt_minimal

@tonivade
Copy link

try to add this option to your nativeImage configuration:

    s"-H:JNIConfigurationFiles=${(Compile / resourceDirectory).value / "jni-config.json"}",

Had a similar problem and it was fixed with this option:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants