简体   繁体   English

安装jdk 7u9后无法识别javafx

[英]javafx is not recognized after installing jdk 7u9

I installed jdk 7u9 and added it to the build path of an eclipse Java project. 我安装了jdk 7u9,并将其添加到eclipse Java项目的构建路径中。 However, when I'm trying to import some javafx classes eclipse can't recognize them: 但是,当我尝试导入一些javafx类时,eclipse无法识别它们:

       import javafx.scene.media.Media;

I read at Oracle's website (and a lot of other websites) that javafx is already included in jdk 7u9 and there is no need to install any additional addons. 我在Oracle网站(以及许多其他网站)上了解到,jfk 7u9中已包含javafx,因此无需安装任何其他插件。

What could be the problem? 可能是什么问题呢?

The jfxrt.jar is in the jre/lib folder of your jdk, but not on the default boot classpath. jfxrt.jar位于jdk的jre / lib文件夹中,但不在默认的启动类路径中。 That is why Eclipse won't add it to the "JRE System libraries". 这就是为什么Eclipse不会将其添加到“ JRE系统库”中的原因。

The issue is tracked here . 在此跟踪问题 The fix will be made in Java 8. 该修复程序将在Java 8中进行。

You should add the jar manually to the project build path or use e(fx)clipse and setup a JavaFX Project. 您应该将jar手动添加到项目构建路径,或使用e(fx)clipse并设置JavaFX Project。

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

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