Install Minecraft in Fedora

Minecraft is this game everybody is talking about lately. I found out it existed about two weeks ago and after playing around with the Classic mode in the Left-Handed Toons server, I was convinced I wanted to buy the alpha version which is currently under heavy development.

So I withdrew some founds from my oDesk account and bought the game last friday. That means I was now able to download the jar file and start the game in my computer using my username and password… and so I did.

The thing is having to double-click a jar file every time I wanted to play the game doesn’t look like the best way to “install” an application I’m sure I’ll be using quite often during Christmas. I’m a fedora user and I wanted Minecraft to be available in Gnome at the Applications menu, right under the Games category like any other game.
I decided to spent some time trying to get that done and as result I created the following Bash script.

Since the jar file can’t be distributed, the script uses wget to download it an place in a proper location (/usr/local/minecraft/). The script then add desktop entries to the menu, create some icons and adds a minecraft command to start the game from console. I assumed you already have Sun’s Java Runtime Environment installed and that is available under /usr/java/latest/bin/java. Those paths and others can be easily changed modifying the variables at the top of the file.

The script was only tested in fedora using Gnome, but I think it can work on other environments. Please fork it at GitHub if you find a way to improve it … and I’m sure somebody will.

The icons are a resized version of the big PNG published at Code Shenanigans.