Java Application launch failed. Check Console for possible error messages related to "/Users/X/Project.jar"

2.3k Views Asked by At

Trying to open .JAR file on macOS Ventura intel base laptop running java 8 351. GUI game was built using IntelliJ, Java jdk 19 and JavaFX 19. Getting a console error message with no console appearing. GUI game works perfectly inside IntelliJ, included right libraries and module paths. When building artifacts "exporting jar executable" I get prompted with this error message whenever I'm trying to open it.Error Message

Solutions tried to find where the problem is with no avail

  1. I tried creating simple javafx program and building artifacts.
  2. Built project with different java jdks.
  3. Built project with visual studio code and eclipse.
  4. Went through the same steps on a older macOS

I'm suspecting its a java jre error, any tips on how to fix this problem?

1

There are 1 best solutions below

3
On

You Should Make FXML files in one package and go to project structure -> Modules -> sources. Then select your package of fxml files and mark it as resource.

Pic Of Example Mark Module As Resource

Then Re Arrange getClass().getResourse("") code lines using under scenario

Pic Of Example Direction to resources

The "./" Directly direct into resources.

Jar files cannot read fxml files until you make them as resources