title: Using Java/JavaFX with Maven in Eclipse
body: <p>I am working with Maven in Eclipse, in Windows. I made a JavaFX application that worked fine on other computers, including Linux Mint even without having JavaFX installed, I could not modified them but I could opened. Now I am trying to run it on Ubuntu. And I get this error:</p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.NoClassDefFoundError: Stage
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: Stage
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 7 more
  </code></pre>
  
  <p>I have a .pom that looks like this:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;moduloDistribuidor&lt;/groupId&gt;
    &lt;artifactId&gt;myprogram&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;myProgram&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;2.9.0&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
          &lt;version&gt;2.9.1&lt;/version&gt;
      &lt;/dependency&gt;   
      &lt;!-- https://mvnrepository.com/artifact/org.json/json --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.json&lt;/groupId&gt;
          &lt;artifactId&gt;json&lt;/artifactId&gt;
          &lt;version&gt;20180130&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.xerial&lt;/groupId&gt;
          &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
          &lt;version&gt;3.21.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I have tried to add JavaFX in the .pom just in case that was the problem, but  it still does not work.</p>
  
  <pre><code>  &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.zenjava&lt;/groupId&gt;
                  &lt;artifactId&gt;javafx-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;8.8.3&lt;/version&gt;
                  &lt;configuration&gt;
                       &lt;mainClass&gt;your.main.class.which.extends.javafx.Application&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>