简体   繁体   English

解决所有javafx导入时出错

[英]Error resolving all javafx imports

I have a problem importing an existing project. 我在导入现有项目时遇到问题。

    import javafx.application.Application;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Parent;
    import javafx.scene.Scene;
    import javafx.stage.Stage;

The error: The import javafx cannot be resolved. 错误:无法解析导入javafx。

I use Java 8 OpenJDK amd64 as the JRE System Library. 我将Java 8 OpenJDK amd64用作JRE系统库。 Also i have no idea which version of java the primary version had if you would refer to this solution. 另外,如果您将参考解决方案,我也不知道主要版本具有哪个Java版本。 I use the newest version i can. 我使用最新的版本。
Any ideas? 有任何想法吗?
Thanks 谢谢

The OpenJDK does not contain JavaFX. OpenJDK不包含JavaFX。 You need to install it separetely, if you want to stick with it. 如果要坚持使用,则需要单独安装。 Please check out the OpenJFX project, that provides the open source version. 请签出提供开源版本的OpenJFX项目。

Or you might consider using Oracle's JDK, that contains it out of the box. 或者,您可以考虑使用Oracle的JDK,它开箱即用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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