Konstantin Solomatov
Konstantin Solomatov

Reputation: 10332

How to make maven consider JavaFX as a part of JRE

I experimenting with JavaFX. Since JDK 1.7 JavaFX is now part of JRE, however, when I run maven install and don't specify system dependency with system dependency compilation is failed because JavaFX classes are not found. Is there a way to make maven consider JavaFX as a part of JDK?

Upvotes: 1

Views: 419

Answers (1)

jewelsea
jewelsea

Reputation: 159290

For now, keep jfxrt.jar as a system dependency as you have doing.

As of jdk7u6, even though jfxrt.jar is in the jdk's jre/lib directory, JavaFX is not on the default java classpath due to potential compatability concerns for non-JavaFX programs. In later jdk releases, JavaFX will be added to the default jdk classpath and it will no longer be necessary to specify JavaFX as a maven system dependency for your project.

Upvotes: 3

Related Questions