title: How do I export a JavaFX with extra modules to a JAR
body: <p>I currently have an application utilizing some imported modules like Jackson and MSSQL JDBC. I don't currently use any tool like Maven, Gradle or ANT.
  I've tried to export the JavaFX JAR with them extracted in the JAR like shown in the picture below.
  <a href="https://i.stack.imgur.com/nmPUe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nmPUe.png" alt="Screenshot of artifact with extracted modules" /></a></p>
  <p>But then I get the error:</p>
  <pre><code>Error: Could not find or load main class apicall.Main
  Caused by: java.lang.ClassNotFoundException: apicall.Main
  </code></pre>
  <p>When I include them without extracting them like in the picture below:</p>
  <p><a href="https://i.stack.imgur.com/JJHNQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JJHNQ.png" alt="Screenshot of artifact without extracted modules" /></a></p>
  <p>Then the application runs but throws out the following error when I try to do a call to the SQL database: <code>java.sql.SQLException: No suitable driver found for jdbc:sqlserver</code></p>
  <p>I currently run the JAR by typing the following command in the console:</p>
  <pre><code>java --module-path &quot;C:\Program Files\Java\javafx-sdk-15\lib&quot; --add-modules javafx.controls,javafx.fxml -jar APICall.jar
  </code></pre>
  <p>How do I export the JavaFX JAR with all my required modules to run with the same or similar command as I listed above?</p>
  <p>Edit: The JAR structure is as follows:
  <a href="https://i.stack.imgur.com/bT4Ut.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bT4Ut.png" alt="JAR Structure" /></a></p>
  <p>And the Stack trace looks like this:
  <a href="https://i.stack.imgur.com/JHzGm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JHzGm.png" alt="Stack trace SQL error" /></a></p>