简体   繁体   中英

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM