编译javaFx程序时FXMLLoader错误/警告,虽然程序运行正常 [英] FXMLLoader error/warning when compiling javaFx program, although program runs fine
问题描述
当我编译我的代码时,我得到以下消息:
When I compile my code I get the following message:
javafx.fxml.FXMLLoader $ ValueElement processValue
警告:JavaFX运行时版本8.0.72加载版本为8.0.131的JavaFX API的FXML文档
javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 8.0.131 by JavaFX runtime of version 8.0.72
使用IntelliJ 2017.1.3
Using IntelliJ 2017.1.3
这并不是特别重要,因为程序似乎仍然运行良好,虽然很高兴找出它抛出这些错误/警告的原因
This doesn't particularly matter as the program still seems to run fine, although it'd be nice to find out why it throws these error/warning
推荐答案
我想,你使用Scene Builder工具创建了一个FXML文件。
当场景构建器创建FXML文件时,根有一个属性: xmlns
url,其版本为JDK。
I guess ,you created an FXML file using the Scene Builder tool.
When scene builder creates an FXML file ,the root has a an attribut :xmlns
url which has the version of JDK.
示例:
xmlns="http://javafx.com/javafx/8.0.141"
出现此警告是因为您使用以下命令加载FXML文件:
And this warning happens because you load an FXML file using :
xmlns =http://javafx.com/javafx/8.0.131
xmlns="http://javafx.com/javafx/8.0.131"
但是在您的项目中,您有一个 JDK 8.0.72 ,这意味着您应该将JDK更新到8.0.131或更高版本。
But in your project you have a JDK 8.0.72,which means you should update your JDK to 8.0.131 or more that version.
这篇关于编译javaFx程序时FXMLLoader错误/警告,虽然程序运行正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!