I'm trying to export and run a JavaFX project and after I export the project through Eclipse, resulting in the Jar being created I double click on it and I receive these two error messages from the JVM as pop-ups in windows. "Error: A JNI error has occurred, please check your installation and try again" and "A Java Exception has occurred."
This is the process that I followed to create the Jar file in eclipse.
ProjectName>Export>Java>Runnable JAR file> then selecting the export destination and using the default selected launch configuration. Library handling is selected as "Extract required libraries into generated JAR" and then Finish.
I receive the error messages after attempting to double click the Jar. Please forgive me if this is not the correct process for running the Java program as this is my first time attempting this.
I attempted to download launch4j, and follow this guide, https://medium.com/mpercept-academy/how-to-make-a-executable-file-from-your-java-code-3f521938ae5c, to run it as a .exe in windows but after selecting the minimum JRE as 1.7.0, creating the .exe, and attempting to run it I get a message "JRE 1.7.0 required".
I also attempted to use this script but it was previously used on a Mac and I'm not sure how to create a script equivalent that will work in PowerShell for windows.
export PATH_TO_FX_MODS=/Users/mh6624pa/Documents/javafx-jmods-15.0.1 jlink --module-path $PATH_TO_FX_MODS:bin/edu.ics372.pa2 --add-modules=edu.ics372.pa2 --output pa2 pa2/bin/java -m edu.ics372.pa2/edu.ics372.pa2.DrawDiamond
Here are some details regarding my setup. Corretto 11.0.8.10.1 JavaFX SDK 16 JavaFX-jmods 17.0.0.1 but not sure if I need the jmods or if I do how I would go about using it to make the executable work. Windows 10
When I run the program in eclipse I don't have any compile-time or runtime errors. I'm not sure if it's an issue with the code or if I just don't know how to correctly create the executable. Let me know if you need to see the code or any other details regarding my setup.
[update] I've updated Java JDK to 16 and messed around with the build path and now I am not seeing the error messages anymore but now neither of the .exe or .jar files do anything when clicked.