Intellij IDEA 2018.2无法识别JDK 10的JavaFX软件包 [英] Intellij IDEA 2018.2 does not recognize the JavaFX packages with JDK 10

查看:226
本文介绍了Intellij IDEA 2018.2无法识别JDK 10的JavaFX软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已搜索但未找到有关它的任何详细信息.在 http://www.oracle.com/technetwork/java/javafx /downloads/index.html 它说

I have searched but not found any detailed information about it. In http://www.oracle.com/technetwork/java/javafx/downloads/index.html it says

从JDK 7u6开始,JavaFX包含在标准JDK和JRE软件包中

As of JDK 7u6 JavaFX is included with the standard JDK and JRE bundles

但是我在编译包含javafx.*软件包的代码时遇到错误.软件包未找到.我正在使用Oracle JDK 10.0.2和Intellij Idea 2018.2.在将$JAVA8_HOME/jre/lib/ext/jfxrt.jar添加为库之后,代码即可工作.

But I am getting error on compile the code includes javafx.* packages. The packages are not founding. I am using Oracle JDK 10.0.2 and Intellij Idea 2018.2. Code is worked after I added the $JAVA8_HOME/jre/lib/ext/jfxrt.jar as library.

但是奇怪的是,我能够以目标字节码版本8为目标构建代码,而无需像上面那样从JDK 8中添加jar文件.

But the strange thing is I am able to build the code to target bytecode version 8 without adding the jar file from JDK 8 as above.

所以问题是

如何获取最新的JavaFX?

How can I get the latest JavaFX?

最新的JavaFX是否在JDK 8中?

Is the latest JavaFX is in the JDK 8?

JDK 10包含JavaFX,并且已在命令行中成功编译并运行. Intellij IDEA 2018.2.有问题.它无法识别JavaFX软件包.

JDK 10 includes JavaFX and compiled and ran successfully in command line. There is a problem with Intellij IDEA 2018.2. It does not recognize the JavaFX packages.

Intellij中的错误消息:

The error message in Intellij:

错误:(3,26)java:程序包javafx.application不存在

Error:(3, 26) java: package javafx.application does not exist

注意:在编辑器中编码时没有错误(红色下划线).在Intellij中编译时发生错误.

Note: There is no error while coding in editor (Not underling red). Error occurs when compiling in Intellij.

更新的问题标题.

推荐答案

JavaFX一直包含在Oracle JDK中(包括Java 10).从Java 11开始不再包含JavaFX,但可以在此处单独下载 http://jdk.java.net/openjfx/.

JavaFX is included in Oracle JDK up to and including Java 10. From Java 11 onwards it will not be included anymore but can be downloaded separately here http://jdk.java.net/openjfx/ .

有关如何从版本11开始使用JavaFX的其他信息,也可以在这里找到: http://docs .gluonhq.com/javafx11/.

Additional information on how to get started with JavaFX from version 11 onwards is also available here: http://docs.gluonhq.com/javafx11/ .

这篇关于Intellij IDEA 2018.2无法识别JDK 10的JavaFX软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆