title: How can I get javafx classes into runtime?
body: <p>I am willing to try javafx for the first time, I went to <a href="http://docs.oracle.com/javafx/" rel="noreferrer">Oracle</a> javafx site to find that javafx now comes with the JDK 7u25. I updated my java version but I am not sure what I am looking for. I get "cannot find symbol" errors whenever I try to import and use a javafx class. I found "javafx-mx.jar" "javafx-doclet.jar" "ant-javafx.jar" files in %JAVA_HOME%/lib but as far as I understand, those are meant to be used by the JRE not the JDK. I would really like not to be dependant on any eclipse plugins. I use maven for the build process. I have seen a couple of javafx maven plugins, but they seem to target the javafx tools. Am I getting the wrong picture? How would I get those classes to be imported correctly?</p>
  
  <p>EDIT</p>
  
  <p>Now I am able to compile the project using what I found <a href="http://www.guigarage.com/2012/10/building-javafx-applications-with-maven/" rel="noreferrer">here</a>. It suggest to add:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.oracle&lt;/groupId&gt;
    &lt;artifactId&gt;javafx&lt;/artifactId&gt;
    &lt;version&gt;2.2&lt;/version&gt;
    &lt;scope&gt;system&lt;/scope&gt;
    &lt;systemPath&gt;${java.home}/lib/jfxrt.jar&lt;/systemPath&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>This solved my build issues, but I can't run the program, I am trying to run this simple <a href="http://docs.oracle.com/javafx/2/get_started/hello_world.htm" rel="noreferrer">example</a>, but I get this error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: javafx/application/Application
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
      at java.lang.Thread.run(Thread.java:724)
  Caused by: java.lang.ClassNotFoundException: javafx.application.Application
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  </code></pre>
  
  <p>Any ideas on how to add the same library to runtime? I am using <a href="http://mojo.codehaus.org/exec-maven-plugin/" rel="noreferrer">maven-exec-plugin</a>.</p>