title: Maven dependency for JavaFX using OpenJDK 1.8
body: <p><strong>Environment:</strong></p>
  
  <ul>
  <li><strong>OS:</strong> For developing and running the application, both Windows 10 Pro (1809) and Linux (something like Ubuntu or Debian) with OpenJDK 1.8 and Maven installed will be used.</li>
  <li><strong>JDK:</strong> OpenJDK 1.8</li>
  <li><strong>IDE:</strong> IntelliJ Ultimate</li>
  <li><strong>Build tool</strong> Maven (multi-module project, one module uses JavaFX)</li>
  <li>I'd very much prefer not to use anything with a paid license (even though, for this project, I could probably use the Oracle JDK for free...).</li>
  </ul>
  
  <p><strong>The problem:</strong></p>
  
  <p>I know, that the JDK 1.8 is supposed to come with JavaFX included. However, for OpenJDK 1.8 this, somehow, seems not to be the case (without the Maven dependencies, IntelliJ doesn't accept <code>import javafx.application.Application;</code> nor any other JFX imports).</p>
  
  <p>For this reason, I am trying to include it as a Maven dependency. If I use:</p>
  
  <pre><code>    &lt;!-- JavaFX --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
          &lt;artifactId&gt;javafx-controls&lt;/artifactId&gt;
          &lt;version&gt;11&lt;/version&gt;
      &lt;/dependency&gt;
      .
      .
      .
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Error:(3, 26) java: cannot access javafx.application.Application
     bad class file: /C:/Users/kaspa/.m2/repository/org/openjfx/javafx- 
     graphics/11/javafx-graphics-11-win.jar!/javafx/application/Application.class
     class file has wrong version 54.0, should be 52.0
     Please remove or make sure it appears in the correct subdirectory of the 
     classpath.
  </code></pre>
  
  <p>Using <code>&lt;version&gt;12&lt;/version&gt;</code> yields <code>[...]wrong version 55.0, should be 52.0[...]</code>.</p>
  
  <p>The lowest <code>&lt;version&gt;</code>, inside the Maven <code>&lt;dependency&gt;</code>, I am able to use seems to bo 11.</p>
  
  <p><strong>The Question:</strong></p>
  
  <ul>
  <li>Is there something I can add/change to my <code>pom.xml</code> to make my application compile and run?</li>
  <li>Do I absolutely need to upgrade to OpenJDK 11 or 12?</li>
  </ul>