0

I have installed the e(fx)clipse for eclipse,and i needed it to import javafx.application.Application, but even after i have installed the e(fx)clipse, and i right click on Application, it will only show me com.apple.eawt instead of javafx.application.Application

And i have tried every step for example, reinstalled eclipse, but still not working

public class Temperature extends Application{

}

i just want to know what should i do , to make it work with javafx.application.Application instead of com.apple.eawt,thank you very much.

  • 2
    In JDK 11+ JavaFX has been separated from the JDK, see this: https://stackoverflow.com/questions/52144931/how-to-add-javafx-runtime-to-eclipse-in-java-11 – Politic Revolutionnaire Jul 25 '19 at 16:03
  • One might add that e(fx)clipse has nothing to do with your problem. In order to write and execute a JavaFX program in Eclipse you don't need e(fx)clipse although it is a helpfull tool for other reasons. – mipa Jul 25 '19 at 17:29

1 Answers1

1

As Politic mentioned in his comment, in Java 11+ Java FX is not part of JDK anymore. You have to import it manually. If you are using Maven add this dependency:

<!-- https://mvnrepository.com/artifact/org.openjfx/javafx -->
<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx</artifactId>
    <version>11</version>
    <type>pom</type>
</dependency>
Alan Sereb
  • 2,358
  • 2
  • 17
  • 31