JavaFX: Weird ClassNotFoundException after updating to Java 9

感情迁移 提交于 2019-12-28 06:49:11

问题


I started a Maven project in Java 8 and wanted to migrate it to Java 9. At the same time I also went from Eclipse Neon EE to Eclipse Oxygen EE. (JFX SDK reinstalled). While the Eclipse Workspace shows no errors; as soon as I try to compile and run the exact same program that used to run perfectly fine in Java 8, I get the following Exception:

{...}
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 26 more

Exception running application application.Main

I have now rebuilt the project several times and cannot get it to work...


回答1:


In Java 9, the previous internal class

com.sun.javafx.css.converters.PaintConverter

became public as

javafx.css.converter.PaintConverter in the module javafx.graphics.

See Javadoc - Class PaintConverter.

JFoenix supports Java 9 with a separate JAR.



来源:https://stackoverflow.com/questions/46754639/javafx-weird-classnotfoundexception-after-updating-to-java-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!