Jar for JavaFX error

I am trying to create a jar file from my JavaFX application but I cant get it to work.
I create an artifact with my code, on the manifest properties set the main class to my main class (Class Path empty)
I build and create the artifact. When I run the .jar file placed in production folder I get following error:

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application

 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14

As a result I copy my project files to Netbeans, which produces a working jar automatically when I build with the same code.

What do I need to change on my configuration so intelli can produce a working jar ?

I am using IntelliJ12.0.4 on OSX 8.3.

1 comment

John, IntelliJ IDEA 12.0.4 doesn't support JavaFX developement and you build a simple jar which doesn't include specific javafx launcher etc. You need either use a build task written by yourself or update to IDEA 12.1 RC build which includes support for javafx (please find describing posts at http://blogs.jetbrains.com/idea)


Please sign in to leave a comment.