Making Minecraft use 64-bit Java on the Mac

In the default install of Minecraft on the Mac you are using 32 bit java and the game warns that you can improve things by switching to 64-bit Java. I found a minecraft forum article that explains how to change things up to 64-bit here. The instructions also state that you’ll have to redo this every time you update minecraft and being lazy I decided to write out a script to make the changes for me. This is that script! All you need to do to use it is open Terminal.app (or your favorite terminal program, mine is iTerm2) and edit a new file, name it something like 64bitminecraft.sh. Then paste the script below into that file and run it by executing ‘bash ./64bitminecraft.sh’. If you’re new to shell scripting in unix here is a good introduction to shell scripting

#!/bin/bash

# Perform Backup of all the files

if [[ ! -d ~/Minecraft_Backups/ ]];then
echo "Creating backup directory ~/Minecraft_Backups/"
mkdir -p ~/Minecraft_Backups/
fi
tar -czf ~/Minecraft_Backups/`date +%Y%m%d`-backup.tgz /Applications/Minecraft/Minecraft.app

#Modify the Info.plist file for the new version of Java
if [[ -a /Applications/Minecraft/Minecraft.app/Contents/Info.plist ]];then
sed -i -e 's/1\.5\+/1.6+/' /Applications/Minecraft/Minecraft.app/Contents/Info.plist
sed -i -e '/I386/ c\
X86_64<\/string>\
I386<\/string>\
' /Applications/Minecraft/Minecraft.app/Contents/Info.plist
else
echo "Info.plist not found in /Applications/Minecraft/Minecraft.app/Contents/"
fi

cp /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub /Applications/Minecraft/Minecraft.app/Contents/MacOS/</code>

2 thoughts on “Making Minecraft use 64-bit Java on the Mac

  1. A link to the article you found would be nice.

    Also, for those of us who aren’t Java wizards, it would also be nice to provide instructions on how to implement this code.

  2. Thanks for the feedback! I’ve included some basic instructions and a link to an apple article about shell scripting. I also changed the theme of my site because it was hiding the link to the original forum post, but it should be visible now.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>