Run Java applications created with Apple's outdated bundler
Sometimes you download an OSX app and when you try to run it you get To open "Something.app" you need to install the legacy Java SE 6 runtime..
This Stack Overflow question explains it in detail.
This script reads the Info.plist file in an application generated by the bundler and builds the command line arguments for running the jar directly.
Of course, you still need the app downloaded, and Java installed and available at the command line.
I made this script for Runescape and Minecraft; it may not work for everything else, but at the very least it'll give you an idea of how to manually figure out how to run a jar bundled in an app.
- To download, run
wget -O <path to file> https://raw.githubusercontent.com/Raekye/OSX-Java-app/master/java.shat the command line- If you've never used the command line before, it looks scary but is actually straightforward (for this anyways)
- Open the Terminal app under the "Other" folder in your Applications, or search for it in Spotlight
- If you want to be able to double click and run, name the file with a
.commandextension, and I recommend placing it on your desktop
- If you've never used the command line before, it looks scary but is actually straightforward (for this anyways)
chmod u+x <path to file>to make it executable
Look for the following at the beginning of the script and follow the instructions.
# Uncomment and edit the line below if you want to run this without arguments
# e.g. "cd /Applications/Minecraft.app/"
# e.g. "cd /Applications/Runescape.app/"
# cd /path/to/MyApplication.app/
# Run these commands in Terminal
cd ~/Desktop/
wget -O minecraft.command https://raw.githubusercontent.com/Raekye/OSX-Java-app/master/java.sh
chmod u+x minecraft.command
# Edit the file so you can run it without arguments, as explained above
open -a TextEdit minecraft.command
./java.sh [--print] [path]
--print: Only print the built command, don't run itpath: Path to the application, e.g./Applications/Runescape.app/. If blank, assume the current directory- As explained above, you can uncomment and edit
cd /path/to/MyApplication.app/so you can run the script without specifying the path every time
- As explained above, you can uncomment and edit