Itai
Itai

Reputation: 6911

JavaFX FXML API version warning

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

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

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.

The root node of the FXML does have the attribute

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

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)?

Edit:
Running the code James_D suggested gives the following results:

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

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

Upvotes: 47

Views: 125781

Answers (9)

This warning occurs because your JavaFX API version and JavaFX runtime version are not the same.

  • But if you try to manually change the version for the xml file, some of the buttons in the UI you created will not work.
  • Therefore, you ignore the JavaFX API version of the FXML document.

you change the xml file code line like below

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

Upvotes: 1

ARY
ARY

Reputation: 11

I was also having samme problem will i was loading my fxml file WARNING: Loading FXML document with JavaFX API of version 8.0.171 by JavaFX runtime of version 8.0.111 then i went to oracle website and update the jre till 171 update of java 8.0 enter image description here

Upvotes: 1

Shekhar Rai
Shekhar Rai

Reputation: 2058

I think your JDK version is 1.8.0_60 and JRE version is 1.8.0_65.

So you should use the same version for both of them.

You can check your current JDK and JRE versions on your command prompt respectively,

java -version
javac -version

or you can go through the System properties using following java code,

System.out.println(System.getProperties());

Upvotes: 9

Reza
Reza

Reputation: 875

Same was for me. as you mentioned your scene builder version is 8.1.0 while your Javafx version is 8.0.60. well they're different:) two way to fix this

  • uninstall current scene builder and install the one with same version of your Javafx
  • every time you edit a FXML file using scene builder, change xmlns property in your header to your Javafx version

for example my javafx version is 9.0.1 while I use scene builder 10.0.1 but after editing in scene builder I change

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

to

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

for may own sake :)

Upvotes: 2

I had same issues but I solved it by going through this steps

If you are using Intellij IDEA goto File -> Project Structure -> SDKs and click on the (-) sign to remove all other JDK you have before then click on the (+) sign to add the new JDK to the project from you C:\Program Files (x86)\Java\jdk1.8.0_172.

Upvotes: 0

Adam Sokołowski
Adam Sokołowski

Reputation: 91

I had same issue. Dunno what IDE you guys are running, but I fixed it on Eclipse.

Inside project explorer on right side of JRE System Library it was showing [J2SE-1.5]. I right clicked JRE System Library, went in Properties. Switched from Execution Environement to Workspace default environement.

If inside workspace default environement brackets it does not show your newest jdk version eg. (jdk1.8.0_192) your can change it by picking Installed JREs button and switching checked JRE.

If your jdk is not listed add it with ADD button and pick your JDK directory eg. C:\Program Files\Java\jdk1.8.0_192, as home directory.

In case, for some reason, you don't want to change your default environement just pick Alternate JRE instead of Workspace default JRE. Then pick right SDK from dropdown menu.

PS. Yes you can change version under xmlns option inside your fxml file, but you will have to update entry every time you modify your fxml inside Scene Builder.

Upvotes: 3

Sara
Sara

Reputation: 147

I have that problem also. I managed it just to change lines in *.fxml files:

javafx/8.0.171 -> javafx/8.0.141

Previously it was like this, it is a line in the begining of fxml file:

<AnchorPane prefHeight="300.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.application.word.view.LoginController">

Then I changed it for:

<AnchorPane prefHeight="300.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.application.word.view.LoginController">

And it works without any problem. But be carefull that it can be different if you use different jdk generations.

Upvotes: 15

sproketboy
sproketboy

Reputation: 9452

If you use the form:

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.

Upvotes: 76

Sergey
Sergey

Reputation: 344

I had the same issue on Linux with Intellij IDEA. I have solved it by installing the latest Oracle JDK, and providing its path in IDEA's "Project Sturucture" settings menu:

File/Project Sturucture/Platform Settings/SDKs

Upvotes: 0

Related Questions