在JRE 8中使用JavaFX [英] Using JavaFX in JRE 8

查看:430
本文介绍了在JRE 8中使用JavaFX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在我的新java 8项目中使用javafx相关的类时,我从eclipse获得访问限制错误。到目前为止,我唯一能够找到的解决方案是告诉eclipse忽略访问限制,但是我不满意。
错误的示例:

When trying to use javafx related classes in my new java 8 project I get an access restriction error from eclipse. So far the only 'solution' I've been able to find is to tell eclipse to ignore the access restriction, but I am not satisfied with that. An example of the error:

Access restriction: The type Pane is not accessible due to 
restriction on required library C:\Program Files\Java\jre8_0\lib\ext\jfxrt.jar

我使用Eclipse Kepler与Java 8的Eclipse JDT补丁。

I'm using Eclipse Kepler with the Eclipse JDT patch for java 8.

这似乎是一个与JavaFX不是JavaSE执行环境的一部分。

This seems to be an issue related to the fact that JavaFX is not a part of the JavaSE execution environment.

根据,我现在很难混淆http://en.wikipedia.org/wiki/JavaFX javaFX是JavaSE的一部分。 Eclipse可能不会识别它是javaSE的一部分?

I am now toughly confused as according to http://en.wikipedia.org/wiki/JavaFX javaFX is a part of the JavaSE. Is it possible that Eclipse is not recognizing that it is a part of the javaSE?

推荐答案

从Eclipse的角度来看,错误是完全正确的,因为JavaFX来自扩展类路径,并且在所有Java8虚拟机(例如ibm!)上都不可用。

From the Eclipse Point of view the error is totally correct because JavaFX is coming from the extension classpath and is not available on ALL Java8 VMs (e.g. ibm!).

根据概述,您可以通过添加访问来抑制这些警告-rules或IMHO最好的解决方案是安装e(fx)剪辑,这对你自动执行,除此之外,甚至为您提供了JavaFX CSS和FXML的工具。

As outlined you can suppress those warnings by add access-rules or IMHO the best solution is to install e(fx)clipse which does this automatically for you and beside that even provides you tooling for JavaFX CSS and FXML.

你可以从 http://efxclipse.bestsolution.at/install.html

这篇关于在JRE 8中使用JavaFX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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