-1

How do I import javafx in eclipse? Why is it not added by default with jre or jdk? What is the recommended forms library in java?

I have installed e(fx)clipse 3.6.0 plugin but it did not help.

This is screenshot of my project libraries. enter image description here

hal
  • 831
  • 3
  • 13
  • 32
  • 2
    Does this answer your question? [How to add JavaFX runtime to Eclipse in Java 11?](https://stackoverflow.com/questions/52144931/how-to-add-javafx-runtime-to-eclipse-in-java-11) – fxweidinger Jan 30 '20 at 13:15

1 Answers1

2

Since JDK 11, JavaFX has been decoupled from the JDK.

This means you must import it as you would any other library. This is different to previous versions in which it was included as part of the JDK.

You must:

  • Make sure the JavaFX jars are available on the classpath. (You can do this by downloading the jars manually and copying them in, or through a build system like maven or gradle)
  • Import the classes you need in your source file

Note that there are several jars you may want (e.g core, components, swing compatibility, fxml support, etc).

cameron1024
  • 9,083
  • 2
  • 16
  • 36