How can I find out at runtime which version of JavaFX I'm using?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
One of simple ways is to simply read the
javafx.properties
file located in your$JAVA_HOME/jre/lib
directory.I have Java 1.7 u9 installed at the moment. JavaFX bundled with it is v2.0.3 so the abovementioned file contains the following line:
You can get the
javafx.runtime.version
number from a System Property.Note that the System Property access method may cause a security exception if an unsigned application is embedded in a browser or accessed via WebStart, so Sergey's
com.sun
call may be better even though allcom.sun
calls are deprecated and not part of the official JavaFX public API.Update
@assylias comments on Sergey's answer would seem to indicate that Sergey's
com.sun
may cause a security exception if an unsigned application is embedded in a browser or accessed via WebStart. So perhaps there is no good solution to determining the javafx runtime version when running under those specific conditions.