问题
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