package javafx.util does not exist?

Tags: , , ,



I am using openjdk version “1.8.0_252” and I also separately install the javafx and currently the version is javafx.version=11.0.2-internal. I have added the javafx lib path in the intellij. There is no error while writing the code javafx Pair. However when I build the project with sudo mvn clean install I got build failure with the following error:

javafx.util does not exist
cannot find symbol
  symbol:   class Pair

Answer

The answer to your question is simple. JDK 8 and JFX 11 are just not compatibel with each other. You need at least JDK 11 before you can use any JFX >= 11. I reccommend the latest JFX (14 or even 15 EA, because it contains the most bug fixes) in combination with a JDK >= 11.



Source: stackoverflow