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.
question from:
https://stackoverflow.com/questions/65864786/creating-standalone-mac-app-from-jar-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…