Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
771 views
in Technique[技术] by (71.8m points)

javafx - How to set preferred version in Scene Builder?

There is an issue I'm facing with Scene Builder where it keeps overwriting the JavaFX version to 15.0.1 whereas I am using version 11.0.2, so I get this warning when running:

WARNING: Loading FXML document with JavaFX API of version 15.0.1 by JavaFX runtime of version 11.0.2

I just edit the version number in the .fxml file:

<Pane maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="293.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">

But when I make any changes in Scene Builder, it puts it back to 15.0.1 and I get the warning.

How can I fix this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since SceneBuilder takes: System.getProperty("javafx.version") as check for its namespace. Maybe try to set this to desired version.

Edit: Open configuration file where your ScenBuilder is installed: e.g.:

C:Program FilesSceneBuilderappSceneBuilder.cfg

Inside under [JavaOptions] add:

java-options=-Djavafx.version=null

You can set it to your current version, but if it is set to NULL it wont check versions or put warning even you open FXML file in SceneBuilder with other version of JavaFX.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...