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.

Advertisements
Tagged , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: