Saturday, December 31, 2011

64-bit Java not recognized in Minecraft

Question

When I set the render distance to Far in mine craft (latest version as of December 30 2011) it says that I need to install 64bit java.

Interesting Information:

  • I am running Lion (Mac OS 10.7, latest version), 64-bit
  • I have 64-bit Java installed as well as 32-bit (proved in the screenshot below)
  • I ran a software update (to make sure I had the latest java version)
  • I also ran a "force update" in Minecraft
  • Restarted my machine several times
  • After Googling I checked to see if 64-bit Java was at the top of the list, it was (in screenshot)

This is the error message that I am getting:

64-bit error

Although I can still use the "Far" render distance, it is a tad choppy.

When I open Java Preferences (located in /Applications/Utilities) this is what I see:

enter image description here

Answer

Minecraft on Mac OS X with 64-bit Java

So you're a slave to warning messages and you want Minecraft to use 64-bit Java. Here's how to do it on the command line. These instructions were crafted on MacOS Lion, which should prefer 64-bit Java when possible (Applications/Utilities/Java Preferences). These instructions assume the default Minecraft.app location, in the main /Applications folder. I had a few tabs open, while I was sussing this out, including an excellent forum post, a post on JavaApplicationStub bits, and the official reference for CF keys.

Here we go.

Swap out Minecraft's JavaApplicationStub for the current OS' version:

gzip /Applications/Minecraft.app/Contents/MacOS/JavaApplicationStub
cp
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Resources/MacOS/JavaApplicationStub /Applications/Minecraft.app/Contents/MacOS/

Then, add 64-bit architecture to Minecraft's possibilities:

/usr/libexec/PlistBuddy -c "Add :Java:JVMArchs:0 string 'x86_64'" 
/Applications/Minecraft.app/Contents/Info.plist

Launch. That should do it. Watch out for creepers. Have a nice day.


If everything goes wrong, here's how to roll back from here to your original configuration:

rm /Applications/Minecraft.app/Contents/MacOS/JavaApplicationStub
gunzip /Applications/Minecraft.app/Contents/MacOS/JavaApplicationStub.gz
/usr/libexec/PlistBuddy -c "Delete :Java:JVMArchs:0" /Applications/Minecraft.app/Contents/Info.plist

I did not write this! Source

No comments:

Post a Comment