Eclipse Javafx Runnable Jar

118 views Asked by At

I made a java application using javaFx on Eclipse IDE. I am using JavaSE-11 compiler and the javafx-sdk-11 version. It works when I run it from Eclipse, but now i'm trying to make a runnable .jar of the application.

When I double click on the .jar, nothing happens. I tried installing, uninstalling and reinstalling Java ... Here are the issues I'm having when I try to launch it with [java -jar filename.jar] command :

  • Extracting the required libraries into generated JAR
java : Error : JavaFX runtime components are missing,
 and are required to run this application
  • Packaging the required libraries into generated JAR
java : Graphics Device intialization failed for : d3d, sw
Error initializing QuantumRenderer : no suitable pipeline found

Don't hesitate to ask me more details, I'm not very good at this but I'm trying my best. Thanks

1

There are 1 answers

1
Joku On

I had same problem few days back. I just made another class that doesn't extend Application, and has its own main. Then just launched the application from that class like so:

public class Fakemain {


 public static void main(String[] args) {
     game.main(args);    //this is the class that extends Application
    }
 }   

Let me know if this worked for you.