0

I'm new to java but have built an application in eclipse which functions as intended. The end goal is to create a standalone .app with an icon for a user to click to run the application.

I've exported the project and created a standalone .jar file which when I double click, does not open. I get the error "The Java JAR file "File Name.jar" could not be launched. Check the Console for possible error messages." And when I look in the console, I don't see any error messages.

When I try to open my jar file in terminal with "java filename.jar", I get the error: "Error: could not find or load main class". However, when I launch the jar file in terminal, with "java -jar filename.jar" it opens fine.

I've packaged up the app using JarBundler, however the final .app file does not work either.

I don't know what to troubleshoot in order to get the .app file to open. Do I need my standalone executable jar to be able open without calling "java -jar", or is that unrelated? Why would my java file open with that but not without? Any guidance would be greatly appreciated.

Buster
  • 687
  • 1
  • 7
  • 25

1 Answers1

1

You can use jpackage to create installable packages for Linux, Windows, and macOS. It's part of the JDK, so no need for extra tools.

Cisco
  • 20,972
  • 5
  • 38
  • 60
  • When I try to run jpackage in Terminal I get the error "-bash: jpackage: command not found". I'm running Java version 15.0.2. – Buster Jan 25 '21 at 03:32