Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm having trouble getting Minecraft to launch when I add it to the launcher. If the game is running, I can right click on the icon in the launcher and select "keep in launcher" and the icon stays, but the game won't launch from it.

If I create a launcher on the desktop, then drag that launcher to the unity launcher, the game will start. If I remove the launcher from the desktop, it stays in the Unity launcher, but will not start any more.

Is there some way to add it to the Unity launcher so that it will actually launch?

(Blech, I've said launch far too many times.)

share|improve this question
    
I ended up just creating a folder in home called .launchers and dragging launchers I created on my desktop to that folder. From there I dragged the launcher on to the Unity launcher. Now the launcher works, and the original launcher is hidden. The only downside is that after launching the application, I have the launcher icon, and the running application icon in my launcher. Still waiting on a better solution. –  Spaisekraft Apr 10 '11 at 21:46

8 Answers 8

Setting up a Minecraft launcher on Ubuntu 12.04, these steps worked for me, mostly pieced together from the various other tips.

In a terminal, first fetch a Minecraft image icon:

cd /usr/share/icons; sudo wget http://images.wikia.com/yogbox/images/d/dd/Minecraft_Block.svg

Then create a minecraft.desktop file (using the gedit text editor to keep it user-friendly; just enter the whole "gksudo ..." command at the command line):

gksudo gedit /usr/share/applications/minecraft.desktop

and paste in these contents, and then Save of course:

[Desktop Entry] 
Name=Minecraft
Comment=
Exec=/opt/minecraft.sh
Icon=/usr/share/icons/Minecraft_Block.svg
Terminal=false
Type=Application
StartupNotify=true

Finally (almost), open up your file manager and go to /usr/share/applications - either click the Home Folder icon in your launcher and navigate, or here's the terminal quickie:

nautilus /usr/share/applications &

Locate your new Minecraft entry, and drag it over to your launcher bar.

At this point, you're practically done, except in this case I've created a little Minecraft starter script, saved in /opt/minecraft.sh, which assumes the minecraft.jar file is also saved in /opt. You can change all these "/opt" references to be wherever you've saved the original minecraft.jar file (be sure to change the Exec value in the minecraft.desktop file too).

The minecraft.sh file needs to contain just these three lines:

#!/bin/bash
cd $(dirname "$0")
java -Xmx1024M -Xms512M -cp minecraft.jar net.minecraft.bootstrap.Bootstrap

(NOTE: for versions older than 1.6.1, you will need to use net.minecraft.LauncherFrame instead of net.minecraft.bootstrap.Bootstrap. The internal structure of the file and classes has changed as of 1.6.1.)

and of course that script needs to be executable, e.g. with the command

sudo chmod a+x /opt/minecraft.sh

That's it! Using the starter script, and ensuring it cd's to the folder that contains the minecraft.jar file, seems to be a helpful step that other instructions overlooked.

share|improve this answer
1  
This is the correct answer, I was looking through here to see if someone already posted it. This is the same way I did it though I used ~/.local/share/ for my setup. –  brim4brim May 27 '13 at 0:08
    
One thing you could add to this that I did (and really liked) is adding some desktop action groups to the .desktop for different minecraft launchers so you can start minecraft using, for example, the magic launcher, technic pack launcher, or ftb launcher. –  AJMansfield Jul 28 '13 at 19:39
    
You can download the image in to /usr/share/icons/scaleable/apps/minecraft.svg and so you could refer to the icon as minecraft instead of giving a full path. You may need it to add it to the hicolor folder instead. Using ~/.local/share instead of /usr/share should work fine as well. –  Adam L. S. Jul 28 at 12:04

There is a much easier way to do this. Go to the software centre and search for the package "Main menu" and install it. Also, go to Google images and find a PNG of the minecraft icon: here's one:

Download (save) the PNG and minecraft.jar. I suggest put it in the Home Folder.

Open up "Main Menu" by hitting the Dash BFB and search for Main menu. Click on Games and choose New Item. Next, click the spring button and choose the PNG you downloaded and put in the home folder. For Name, call it Minecraft, description, whatever. For command use this:

java -Xmx1024M -Xms512M -Xincgc -jar ~/minecraft.jar

Change username to your username on Ubuntu. Then once you do that, save it and it should now be in your Menu :D. You can then pin it to the launcher if you want. It will work like any other launcher icon :D.

share|improve this answer
    
The part /home/**username**/minecraft.jar should instead be ~/minecraft.jar. Its shorter, easier to understand, does the same thing, and requires no per-user modification. –  AJMansfield Jul 28 '13 at 19:40
    
Dang it you're right @AJMansfield why didn't I think of that. I fixed the answer. –  jsebean Feb 7 at 2:06

You need a .desktop file for the MineCraft launcher.

gksudo gedit /usr/share/applications/minecraft.desktop

Put the following text into this file:

[Desktop Entry]    
Name=MineCraft    
Comment=    
Exec=COMMAND_FOR_MINECRAFT_LAUNCHER    
Icon=ICONNAME   
Terminal=false    
Type=Application    
StartupNotify=true

Now open a File manager (nautilus). Press Strg + H to show hidden files.

Go to: .gconf-> desktop-> unity-> favourites-> launchers

You'll see many folders starting with "app-". Create a folder for your program. Name it "app-MineCraft".

Now enter one of these app- folders, copy the xml file, paste it into your "app-MineCraft" folder and open the xml file with a text editor. Rename the *.desktop in this file with MineCraft.desktop.

Log out and in again (or restart your computer).

If you did it right, you should now see your icon on the dock.

I hope this helped you, Daniel

Source

share|improve this answer
1  
I don't seem to have a unity folder in .gconf/desktop. I just have a gnome folder. –  Spaisekraft Apr 10 '11 at 21:13
1  
Is this for Unity for Maverick? Seems a lot of the people on the Ubuntu forums you linked are running 10.10. –  Spaisekraft Apr 10 '11 at 21:38
    
@Spacecraft: Oh, sorry I think that's an old version of unity :s But you could just create a shell script, save it to your home folder, then drag it to your unity dock and don't delete the shell file. That should work too :) –  omnidan Apr 11 '11 at 5:07
    
Folders aren't present in default install of ubuntu 12.04, and dragging a shell script to the unity doc also doesn't seem to be allowed... –  Kzqai Oct 2 '12 at 2:20

There is an awesome Minecraft installation script for Ubuntu that will solve all your problems. Here is the link --> http://www.ubuntuvibes.com/2011/04/minecraft-installation-script-updated.html

This will create a Minecraft shortcut icon in actual menu under games. So you need to just launch Minecraft, right click the icon and select 'Keep in Launcher'.

I have done the same thing and it's working nicely. Here a screenshot:

Minecraft

share|improve this answer
    
Might be better to link right to the source since the file sharing service they used doesn't work. --> ubuntuforums.org/showthread.php?t=1726735 –  Kzqai Oct 2 '12 at 2:21

Try using alacarte Install alacarte.

sudo apt-get install alacarte

Then create a new menu item, with the command being "java -jar path/to/your/minecraftfile.jar".

After that search for the name you gave it in ~/.local/share/applications. Drag and drop it to the Launcher or lock the application once it's up to the launcher (by right clicking it while its running).

Much easier then creating a .desktop file

share|improve this answer
    
+1 for solution that does not need gksu ;) –  Takkat Apr 13 '13 at 14:57

According to http://www.omgubuntu.co.uk/2013/04/minecraft-installer-for-ubuntu you can do this:

sudo add-apt-repository ppa:minecraft-installer-peeps/minecraft-installer
sudo apt-get update && sudo apt-get install minecraft-installer
share|improve this answer

With the copy/paste desktop file entry Ubuntu 12.04 and Ubuntu Studio displayed the default icon rather than Minecraft's in Unity and Docky. However, for whatever reason it worked when it was dropped on the desktop.

The problem was caused by the extra space after '[Desktop Entry] ' in the answer above. By removing the space with gedit finally the correct icon got displayed.

So here's the corrected desktop file entry for copy/paste to save some suffering: :)

[Desktop Entry]
Name=Minecraft
Comment=
Exec=/opt/minecraft.sh
Icon=/usr/share/icons/Minecraft_Block.svg
Terminal=false
Type=Application
StartupNotify=true
share|improve this answer

What you'll need to make a minecraft launcher:

  1. Full path to your minecraft.jar
  2. Minecraft icon picture in *.svg format Note: I used the one at this site: http://gimilkhor.deviantart.com/art/Minecraft-icon-193038524 . But, in order to convert the *.png icon to *.svg , I had to install Inkscape, open the *.png, then save it as *.svg (Gimp won't do this). You can install inkscape with:

    sudo apt-get install inkscape
    

Here's how to make the launcher. We'll assume minecraft is in /home/joe-user/Downloads/minecraft/minecraft.jar, and we'll assume the *.png icon file from the above website has opened with inkscape, then saved in *.svg format to ~/Pictures/minecraft.svg

Create a launcher as follows. We'll use vi because we are badass.

sudo vi /usr/share/applications/minecraft.desktop

Put the text below into the launcher, then save it (modify the Exec path to match your minecraft.jar location):

[Desktop Entry]
Name=MineCraft
Comment=ThisGameRocks
Exec=java -jar /home/joe-user/Downloads/minecraft/minecraft.jar
Icon=minecraft
Terminal=false
Type=Application
StartupNotify=true

Now, you have to copy the minecraft.svg file to /usr/share/icons/hicolor/scalable/apps/minecraft.svg (as root, change the source path to fit your situation) so the launcher can find it and use it.

sudo cp ~/Pictures/minecraft.svg /usr/share/icons/hicolor/scalable/apps/minecraft.svg

Notes:

  • The minecraft.jar file should have chmod 755 minecraft.jar permissions
  • The minecraft.svg file should have chmod 644 minecraft.svg permissions
  • Also, the above assumes you have jre installed

    sudo apt-get install openjdk-7-jre
    

Now, you'll be able to find minecraft in the unity searchglass. Then, once you launch it, you can right-click the icon and set "Lock to Launcher".

share|improve this answer
    
Did not work for me for any stage (Ubuntu 12.04) –  Kzqai Oct 2 '12 at 2:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.