解決了maven的一些問題後,我在使用獨立應用程序,我的所有其他庫似乎都正常加載。 我收到此錯誤用java編寫的Maven javafx 8
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas
at mapper.osm.main.Main.createContents(Main.java:280)
at mapper.osm.main.Main.open(Main.java:182)
at mapper.osm.main.Main.main(Main.java:117)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swt.FXCanvas
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
[email protected] MINGW64 ~/git/mapper-osm/mapper.osm/target (master)
$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
我加入這個插件到我的pom.xml,但我仍然得到同樣的問題https://github.com/javafx-maven-plugin/javafx-maven-plugin。
Isnt java 8應該本機運行javafx?
'的JavaFX /嵌入/ SWT/FXCanvas'距離的[JavaFX的SWT保持兼容]一類(https://docs.oracle.com/ JavaSE的/ 8/JavaFX的/互用教程/ FX-swt_interoperability.htm)。它不直接在JDK中。 – Tunaki