Ansen Zhang
Ansen Zhang

Reputation: 1

Why can't i import javafx,even i have installed the e(fx)clipse for eclipse

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.

Upvotes: 0

Views: 132

Answers (1)

Ilya Sereb
Ilya Sereb

Reputation: 2561

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>

Upvotes: 1

Related Questions