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

Not working without JavaFX in classpath #6

Open
Mingun opened this issue Jun 30, 2021 · 0 comments
Open

Not working without JavaFX in classpath #6

Mingun opened this issue Jun 30, 2021 · 0 comments

Comments

@Mingun
Copy link

Mingun commented Jun 30, 2021

Check of presence of JavaFX is useless because you directly depend on the JavaFX classes. NativeJFileChooser won't be loaded at runtime. Fox example, in Java 14 environment:

--- exec-maven-plugin:3.0.0:exec (default-cli) @ Test ---
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/stage/DirectoryChooser
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3244)
	at java.base/java.lang.Class.getDeclaredMethod(Class.java:2551)
	at java.desktop/java.awt.Component.isCoalesceEventsOverriden(Component.java:6321)
	at java.desktop/java.awt.Component$3.run(Component.java:6275)
	at java.desktop/java.awt.Component$3.run(Component.java:6273)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
	at java.desktop/java.awt.Component.checkCoalescing(Component.java:6272)
	at java.desktop/java.awt.Component.<init>(Component.java:6241)
	at java.desktop/java.awt.Container.<init>(Container.java:296)
	at java.desktop/javax.swing.JComponent.<init>(JComponent.java:598)
	at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:347)
	at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:295)
	at li.flor.nativejfilechooser.NativeJFileChooser.<init>(NativeJFileChooser.java:86)
	at test.JFileChooserWithProps.main(JFileChooserWithProps.java:89)
Caused by: java.lang.ClassNotFoundException: javafx.stage.DirectoryChooser
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 15 more
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

1 participant