The place for tech

The place for simple tutorials, software reviews, and many things tech.

Saturday, December 24, 2011

How to install Minecraft on Fedora 19 and under

Minecraft is the only game which I still play on my computer. Minecraft is unique since it is made in a platform-independent programming language called Java. To install it on Fedora 15, you need to get a bit more involved than normal. Reading my previous post about BASH shell scripts may help you out a bit.

First, install sun's java runtime environment here (http://www.java.com/en/download/manual.jsp) Go to the Linux section and download the RPM. When it is finished it can be installed with the software install tool or rpm. That's have the challenge down. Now go to www.minecraft.net and download minecraft.jar. You will notice that when you try to run this .jar file it opens with the archive manager instead. Here is when the slightly harder part comes in.

Go to the directory you have minecraft.jar saved in and make a new document called "Minecraft.sh". In the next few commands replace [path] with the path to Minecraft.jar. Open Minecraft.sh and enter the following:
#! /bin/bash
java -jar [path]
save and close the file. Now make it executable by right clicking it and going to permissions, or using chmod +x from the command line. Double click the file and click "open in terminal". If the terminal opens and closes with quick succession, minecraft threw an exception. To find out what went wrong drag the Minecraft.sh file into a terminal that is already open and run it from there. Google the resulting text.

If everything did go according to plan, minecraft should start normally. If you enjoy mods, then you need to go back to step one and install jre 7 instead of jre 6. The reason I provided the jre 6 link is that it's considered the best option since most java developers are still using it to write their programs / mods.

Alternate Route
There is an alternate, slightly more advanced route to launching minecraft. Go to your desktop and make the text document "minecraft" or whatever you want to name it. Now, copy this information but, once again, change [path] to where your minecraft is located. USER_NAME should be replaced with your username. That entire string should be replaced with a path to the picture.


[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraft
Comment=A game about moving blocks and killing monsters.
Exec=java -jar [path]
Icon=/home/USER_NAME/Pictures/Icons/Applications/Minecraft Icon.png
Path=
Terminal=false

Categories=Games
StartupNotify=false

  When you are done, give the file a ".desktop" extension. This will directly launch the program with a double-click rather than asking you to run it. If you have permission to become root, you can copy this to /usr/share/applications or ~.local/share/applications. Now you can access it from programs like the gnome menu or any type of launcher for even quicker access.
The content in this post is public property
Happy mining

9 comments:

  1. This helped a lot. Thank you for putting this together.
    Mind you, for the reference to changing [path] to, as example, home/yourname/Documents/minecraft.jar

    I had to figure this out after a few tries. All the same this was a great help. :)

    ReplyDelete
  2. i can start Minecraft, i can log in but then a black screen appears and nothing else happens...what can i do?

    can u email me? frankseel@gmx.de

    ReplyDelete
    Replies
    1. Since this is a common problem it would be better to answer it here instead of email.

      The black screen can be caused by two problems.

      1) You may not have a graphics driver installed
      If you use a video card you may not have the correct drivers installed. You should be able to find out from the "System Information" program. I've had problems in the past with video cards, so you should be careful. (The first time that I tried it removed everything relating to X...)

      2) (more likely) You are not using Oracle's Java VM
      Notch asks his users to use Oracle's Java virtual machine instead of openjdk-*-jre. I'm not sure the reasoning behind this, but it is good to follow his recommendation. You can download Oracle's JVM here: http://www.java.com/en/download/manual.jsp

      Delete
    2. Another possibility is that you are running a dual monitor setup which Minecraft currently has a problem with. Mojang is working on it, but for now you will have to update the file manually.
      Just search up Minecraft Linux Black Screen fix and you should find some YouTube videos with the download link and instructions.

      Delete
  3. Hello I have done all of the above but it keeps telling me that permission is denied do you guys know why?

    ReplyDelete
    Replies
    1. There are two reasons. One could be that a file or directory you are working in is owned by your root account. Type sudo chown username file nameto re-own your file.

      Another reason is that you don't have the file set to be executable. chmod +x filename on the file to execute will make it executable. In this case, you should own your minecraft directory
      sudo chown -R username /home/USERNAME/.minecraft
      and minecraft.jar should be executable.

      Delete
    2. i do not get it

      Delete
  4. Hello, I am having problems with getting the .minecraft folder in general, unless it is invisible, can you help me here? You see i downloaded Java and just launched it like that, but when I log in, the screen goes black. I have tried many times to find the .minecraft file, but could never find it, also Fedora wont let me create any files (or show any files) with a dot in front of them.

    ReplyDelete
    Replies
    1. Folders and files with a . in front of them (hidden files, or "dotfiles") are not shown at all times in Fedora's file manager Nautilus. The ctrl+h shortcut in a file manager (or alt+. in KDE's Dolphin) will show all dotfiles.

      As for the screen being black, this is common on older distributions of Linux. java-1.7.0-openjdk is the open source package that seems to work the best for Minecraft, but Sun's Java JRE is the preferred way to launch Minecraft.

      Delete