JavaFX FXML API 版本警告 [英] JavaFX FXML API version warning

查看:35
本文介绍了JavaFX FXML API 版本警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在启动 JavaFX 应用程序时开始注意到以下警告:

I have recently started noticing the following warning when starting my JavaFX application:

警告:通过 8.0.60 版的 JavaFX 运行时使用 8.0.65 版的 JavaFX API 加载 FXML 文档

WARNING: Loading FXML document with JavaFX API of version 8.0.65 by JavaFX runtime of version 8.0.60

有问题的 FXML 是由 Gluon Scene Builder 8.1.0 创建的,与它捆绑的 Java 版本 1.8.0_65 一起运行.该应用程序使用我的 OS Java 版本 1.8.0_72 启动.

The FXML in question was created by Gluon Scene Builder 8.1.0, running with it's bundled Java, version 1.8.0_65. The application is launched with my OS Java, version 1.8.0_72.

FXML 的根节点确实有属性

The root node of the FXML does have the attribute

xmlns="http://javafx.com/javafx/8.0.65"

但我认为 1.8.0_72 > 1.8.0_65,为什么我会收到这条消息?这是我应该担心的事情吗?有没有办法询问 jre 什么是 JavaFX API 版本(这显然与 Java 版本不同)?

but I figured 1.8.0_72 > 1.8.0_65, so why am I getting this message? Is it something I should be worried about? And is there a way to ask the jre what is the JavaFX API version (which, apparently, is not the same as the Java version)?


运行 James_D 建议的代码会得到以下结果:


Running the code James_D suggested gives the following results:

java 版本:1.8.0_72-internal
javafx.version: 8.0.60

java version: 1.8.0_72-internal
javafx.version: 8.0.60

那么,看起来 JDK 中的 JavaFX 版本是错误的?或者我有一个旧的 jfxrt.jar?我会调查一下.

So, looks like the JavaFX version in the JDK is wrong? Or maybe I have an old jfxrt.jar? I'll look into that.

推荐答案

如果使用表单:

xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"

版本控制被忽略.只有在与其他版本存在兼容性问题时才需要它.

The versioning is ignored. You'd only need it if you had some compatibility issue with another version.

这篇关于JavaFX FXML API 版本警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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