2

so i'm trying to install minecraft on Ubuntu 16.04 and i installed minecraft.jar cant run it it is excutive so it should run but it dos'nt java's file is there but it cant run either any suggestions?

2 Answers 2

2

Should be an easy fix.

Use your file manager to find the Minecraft.jar and right-click on it. Choose Properties. Click on the Permissions tab and look down the list where it says Execute: Make sure the box is checked for "Allow executing file as a program." Close the properties window and now try double-clicking the Minecraft.jar file. If java is installed, it should start the launcher.

If you get any kind of error, you may need to install Java. An easy way to do that is to open a terminal window by pressing Ctrl+Alt+T. Then type the following pressing enter after each line (enter your password if asked):

sudo apt update
sudo apt install default-jre

That should install the basic java runtime. Try double-clicking on the minecraft.jar file again. If it still doesn't run, then reboot and try double-clicking again. Just make sure that executable checkbox is checked.

If you get some weird bugs in your window, open the terminal again (Ctrl+Alt+T) and run this:

sudo update-ca-certificates --fresh

and press enter. After entering your password, it should update your certificates and after running it again it should then work. Just a heads up because I had to do it for some weird reason. :)

Good luck!

1
  • Thanks java did not install right i guess (i downloaded it from java's website not through terminal)
    – Ste1n
    May 21, 2016 at 23:58
0

Step 1: check to see if your Ubuntu is 32-bit or 64-bit. You can do this by typing file /sbin/init in terminal. All commands will be in terminal unless otherwise specified (the rest of the commands will be assuming you use a 64-bit system).

Step 2: Check if you have java already installed (which I don't think you do). java -version. If you have OpenJDK installed on your system it may look like this: java version "1.7.0_15" OpenJDK Runtime Environment (IcedTea6 1.10pre) (7b15~pre1-0lucid1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) If you have OpenJDK installed on your system, you have the wrong vendor version of Java installed.

Step 3: Remove OpenJDK if installed. sudo apt-get purge openjdk-\*. This command will completely remove OpenJDK/JRE from your system. You also need somewhere to put java when we install it. Type: sudo mkdir -p /usr/local/java.

Step 4: Download the Oracle Java JDK for Linux. You can do that here: http://www.oracle.com/technetwork/java/javase/downloads/index.html. Make sure you download the correct one (i.e. if you have a 64-bit system, download the 64-bit version).

Step 5: Copy the files into your new directory. sudo cp -r jdk-8u20-linux-x64.tar.gz /usr/local/java/ (note that the numbers of the file might be different than what I've typed. Make sure you are using the correct file. Also note that this is the 64-bit version. If you are using the 32-bit version, you'll type something like this: sudo cp -r jdk-8u20-linux-i586.tar.gz /usr/local/java/). Finally, move into that folder. cd /usr/local/java.

Step 6: Now I need to explain something. .tar.gz files are not similar to .exe or .app files. They're closer to a .zip file. Think of it as a file archive. With that in mind, "extract" the files using sudo tar xvzf jdk-8u20-linux-x64.tar.gz.

Step 7: Check you directory. You should have two things in it. So, type ls -a and it should return something like jdk1.8.0_20 and jre1.8.0_20

Step 8: Edit the system PATH file /etc/profile and add the following system variables to your system path. Use nano, gedit or any other text editor, as root, open up /etc/profile. Type sudo gedit /etc/profile or sudo nano /etc/profile. You can choose either as there is really no difference.

Step 9: Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file

    JAVA_HOME=/usr/local/java/jdk1.8.0_20
    JRE_HOME=/usr/local/java/jre1.8.0_20
    PATH=$PATH:$JRE_HOME/bin:$JAVA_HOME/bin
    export JAVA_HOME
    export JRE_HOME
    export PATH`

Save this and exit.

Step 10: Type sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.8.0_20/bin/java" 1. This tells Ubuntu JRE is available for use. Type sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.8.0_20/bin/javac" 1. This tells Ubuntu JDK is available for use. Finally type sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.8.0_20/bin/javaws" 1. This tells Ubuntu Java Web Start is available.

Step 11: Set Java to default Java by typing in the following commands.

    sudo update-alternatives --set java /usr/local/java/jdk1.8.0_20/bin/java
    sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_20/bin/javac
    sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_20/bin/javaws

Step 12: Reload your system wide PATH /etc/profile by typing the following command: source /etc/profile. You'll have to reboot for this to take effect, but before you do, type java -version. A successful 64-bit installation will say

    ava version "1.8.0_20"
    Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
    Java HotSpot(TM) Server VM (build 25.20-b23, mixed mode)

Congratulations! Your Java installation worked. Restart for this to take effect. Now, to run Minecraft, you should just have to right click the program, open properties and check the "allow executing as program" check-box. Then, double-click it to run. Enjoy!

1
  • Sorry for the lengthy answer. I've used this on multiple Ubuntu systems and it has yet to fail me, so I'm just making sure I don't miss any details. :D
    – James
    May 21, 2016 at 3:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .