JavaFX: Latest version of javafx-runtime

2019-07-29 05:39发布

问题:

What is the latest version of javafx runtime?

I tried to add the following dependency:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>javafx-runtime</artifactId>
    <version>2.2.25</version>
</dependency>

I get the following error while saving my pom.xml.

Missing artifact com.oracle:javafx-runtime:jar:2.2.25

I tried updating the project dependencies but that did not help. Any pointers will be helpful.

回答1:

Current Version of JavaFX - 10/3/2013

The current version of JavaFX is JavaFX 2.2.40 and is distributed inside Oracle Java 7u40.

You can get the development kit for Java7u40 from:

  • http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

And if you just need the runtime and not the rest of the development kit, it is available at:

  • www.java.com/getjava/

Regarding JavaFX and Maven

I think you are trying to use JavaFX as a Maven dependency. However, JavaFX is not hosted in a public Maven repository. Similar to other parts of the Java runtime like the Java collections libraries or the Swing GUI toolkit, JavaFX does not need to be hosted in a Maven repository as it is included as part of the underlying Java runtime.

To see how to use JavaFX from Maven as system dependency, refer to the Stackoverflow question: Maven project with JavaFX (with jar file in `lib`).

If you are working with JavaFX and Maven, likely the best solution is to use the JavaFX Maven Plugin.