Tag Archives: maven

JavaFX 2 & Maven

One of the annoying thing with JavaFX 2 is that it is co-bundled with the JDK since Java 7u7 but is not on the classpath by default.

One way, in Netbeans, is to create a Maven JavaFX project (although I have been somewhat unlucky with that approach).

There are various alternatives proposed on the web – one that worked for me consists in playing with the pom file to include JavaFX in the classpath with:

<dependency>
    <groupId>javafx</groupId>
    <artifactId>jfxrt</artifactId>
    <scope>system</scope>
    <systemPath>${java.home}/lib/jfxrt.jar</systemPath>
    <version>2.2.4</version>
</dependency>

Although this might not be the best approach, it seems to work fine.

Tagged , ,