4

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...

fabian
  • 67,623
  • 12
  • 74
  • 102
PMC
  • 61
  • 2
  • 4
  • Update: I am using JFoenix in my project, which seems to require the com.sun.javafx.css.converters.PaintConverter class in some classes like the JFXTextField. Is it possible, that said package has been removed with Java 9 for some reason? And if so, do I have no choice but going back to Java 8? (Just downgraded it and works fine again) – PMC Oct 15 '17 at 12:35
  • google the package name and 'java 9' for the details. – pvg Oct 15 '17 at 12:43
  • @pvg Yeah, thanks for nothing. I totally didn't have that idea 2 days ago – PMC Oct 15 '17 at 13:32
  • A pleasure, glad you found the answer 2 days ago! – pvg Oct 15 '17 at 13:37

1 Answers1

7

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.

howlger
  • 22,720
  • 8
  • 35
  • 64
  • 2
    If JFoenix is indeed using the internal com.sun class directly then someone should submit a bug to the project to make them aware of the supported/public API. – Alan Bateman Oct 15 '17 at 17:30
  • 1
    @AlanBateman JFoenix has already created its own version for Java 9 (see my extended answer). – howlger Oct 15 '17 at 21:08