Skip to content

Instantly share code, notes, and snippets.

@gormster
Last active August 29, 2015 14:14
Show Gist options
  • Save gormster/64293d9fa8ebf9fc23f7 to your computer and use it in GitHub Desktop.
Save gormster/64293d9fa8ebf9fc23f7 to your computer and use it in GitHub Desktop.
Enable the Minecraft Launcher in OS X Yosemite
echo "This assumes you have Minecraft installed at /Applications/Minecraft.app"
cat << 'EOF' > /Applications/Minecraft.app/Contents/MacOS/Minecraft
#!/bin/sh
PRG=$0
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
if expr "$link" : '^/' 2> /dev/null >/dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
progdir=`dirname "$PRG"`
if [ -n "$JAVA_HOME" ]; then
JAVACMD="$JAVA_HOME/bin/java"
elif [ -x /usr/libexec/java_home ]; then
JAVACMD="`/usr/libexec/java_home`/bin/java"
else
JAVACMD="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
fi
cd "$progdir/../Resources/Java"
exec "$JAVACMD" -classpath "$progdir/../Resources/Java/*" \
-Dapple.laf.useScreenMenuBar=true \
net.minecraft.bootstrap.Bootstrap
EOF
chmod a+x /Applications/Minecraft.app/Contents/MacOS/Minecraft
rm /Applications/Minecraft.app/Contents/MacOS/JavaApplicationStub
xattr -d -r com.apple.quarantine /Applications/Minecraft.app/
defaults delete /Applications/Minecraft.app/Contents/Info.plist Java
defaults write /Applications/Minecraft.app/Contents/Info.plist CFBundleExecutable Minecraft
echo "Minecraft has been patched"
@gormster
Copy link
Author

So, the deal is, you download MinecraftEnableYosemite.command, double click it and - as long as you've got a FRESH copy of Minecraft at /Applications/Minecraft.app (as in, you've just downloaded it and never tried to run it), and a working copy of Java or the JDK (I suggest the 1.7 JDK) - it will patch that application to work properly in Yosemite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment