Jorl17 / jar2app

Convert any Java jar to a Mac OS X .App bundle. No external tools needed, no funky parameters, it just works.
GNU General Public License v2.0
418 stars 56 forks source link

Not even including my own JRE, but still getting "Unable to load Java Runtime Environment" error #49

Closed zbm8121 closed 3 years ago

zbm8121 commented 3 years ago

I created my own calculator using javaFX and of course java, and I wanted to create an application that I can run instead of the given apple one because I thought it would be funny and (somewhat) cool. I have gotten to the point where I have a jar file; however, I am not able to simply run "java -jar filename.jar". To get it to run on the command line I need to run a much longer command "java --module-path /Users/zbmach/Java/Extensions/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml -jar Calculator-1.0-SNAPSHOT.jar". I assumed that the part starting at --module-path and ending right before the -jar are the jvm options. Because of this I input "jar2app Calculator-1.0-SNAPSHOT.jar -n "Calculator 2" -i Calculator.icns -j "--module-path /Users/zbmach/Java/Extensions/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml" -r "/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home"". I would love if someone could help me figure out what I need to change when creating the app to eliminate the error I am getting!

ddyer0 commented 3 years ago

this sounds like you don't need jar2app at all, you only need a proper manifest file in the jar, containing a main-class and class-path. You can read about that elsewhere. Here's a sample:

Manifest-Version: 1.0 application-name: Boardspace Games permissions: all-permissions codebase: *.boardspace.net class-path: OnlineLobby.jar Game.jar Sounds.jar jzlib.jar OnlineGame.j Main-Class: util.JWSApplication