Associate a shell script (starting a Java JAR) with a file extension in a Mac application bundle
问题 To run a Java8-JAR archive on Macs with a higher Java version I pack the jar into an APP bundle (stuff.app) together with a bash-script, let's call it stuff.sh (edit: removed "-cp" argument, inserted echoing command line arguments): #!/bin/bash VM_ARGS_A="--add-modules=java.xml.bind" # Set the working directory DIR=$(cd "$(dirname "$0")"; pwd) APP_JAR="some-java-stuff.jar" APP_NAME="Some Java Stuff" APP_ICNS="stuff.icns" #test: set command line args STUFF_TITLE="Launching $APP_NAME" STUFF