I have problem importing import "javafx.util.Pair" into my program. after searching the net I've found this answer cannot resolve symbol javafx.application in IntelliJ Idea IDE and I've installed desired jar file but still I've problem to import. this is what I face to when open java jdk. I don't know the why the "jfxrt.jar" is different. note the black arrow on the folder icon
-
is jar included in your classpath? – Amit Apr 22 '17 at 10:14
-
1The black arrow just means this is a symlink to another file. – Henry Apr 22 '17 at 10:14
-
You installed the JAR incorrectly. IntelliJ can't find it. You did something wrong. It's different because you put it in the wrong place. – duffymo Apr 22 '17 at 10:30
2 Answers
open the File | Project Structure dialog, there under Platform Settings select SDKs and then your JDK 1.8. On the right you then see all the jars that make up the classpath to your SDK. Make sure that your jfxrt.jar is in that list, if not, you can add it by clicking the '+' button at the bottom.

- 18,013
- 6
- 50
- 66
Update May 2020
JavaFX is no longer part of the Oracle or OpenJDK default distributions. Instead it is available as a seperate library or module set.
For instructions on using JavaFX in your application, see the documentation at:
For instructions on working with a modern JavaFX installation and Idea, also see the related question:
You don't need to "install the desired jar" (whatever that means).
You don't need to do that for JavaFX. You should not do anything explicitly with jfxrt.jar
either in the filesystem or by adding it to a project classpath. If doing something on the filesystem, that is especially bad as jfxrt.jar is not made to be standalone and requires related native libraries shipped with the JDK in order to work.
The JavaFX code should be part of the JDK installation you are using. Perhaps you are using a Java version below 8 or an OpenJDK implementation that does not include JavaFX. If so, then install the Oracle JDK 8+ and set idea to use it. Everything should just work then and all of related JavaFX imports will resolve.

- 150,031
- 14
- 366
- 406