Error when launching Minecraft on Ubuntu Mate on Raspberry pi 3

java version “1.8.0_151”
Java™ SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot™ Client VM (build 25.151-b12, mixed mode)

Ok. I’m not sure if the following is needed with the last package installed but just in case…

First, check that the Java from the PPA is installed in /usr/lib/jvm/java-8-oracle
Then, if the path is right, edit your .bashrc file (pluma ~/.bashrc) and add this at the end:

JAVA_HOME=/usr/lib/jvm/java-8-oracle
PATH=${PATH}:${JAVA_HOME}/bin

Finally, restart your session (logout/login or reboot).

Ok so this is at the end of the bashrc file.

sources /etc/bash.bashrc).

if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

JAVA_HOME=/usr/lib/jvm/java-8-oracle
PATH=${PATH}:${JAVA_HOME}/bin

Ok. Don’t forget to restart the session if you haven’t, so that it’s taken into account.

Now, you can continue with the tutorial from step 6: download Minecraft, start the launcher, copy the ARM libs in the .minecraft directory and so on.

You’ll have to edit the run.sh file to replace:

/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java \

with this:

/usr/lib/jvm/java-8-oracle/bin/java \

Done now I got this.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 260 100 107 100 153 65 93 0:00:01 0:00:01 --:–:-- 93
todays access token =
Java HotSpot™ Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
Error: Could not find or load main class net.minecraft.client.main.Main

Ok, same problem, as expected. :frowning:

I think we can definitely cross out a Java issue.

Ah ok thanks for helping me thought out this forum. If you have any solution please reply back to this forum. :smile:

Yep. I’ve tried to do some research on the error (Could not find or load main class net.minecraft.client.main.Main) but all I could find was issues related to Java or a corrupted download of the game. Not really helpful.

EDIT: maybe something useful there: https://www.raspberrypi.org/forums/viewtopic.php?p=1045520

It’s about an older version but you can check anyway: start the launcher, edit profile and check what version is in “use version”. Eventually try several choices and be sure that options about snapshots/beta/alpha versions are unchecked.

BTW, do you remember which version you had on Raspbian? It’s possible that the latest one can’t run on the Pi for some reason (even on Raspbian). If you remember, try to set the same one on Ubuntu MATE if possible, to see if it runs. If that’s the case, from there, you can start checking newer versions.

There are potential other solutions in the thread, someone is talking about an alternative launcher, replacing libs and so on. I haven’t read the whole thread but it might be a good idea.

Hey guys,

Both the original 1.8.9 tutorial and 1.12.1 OptiFine tutorial still work for me with minimal modifications. rpiMike monitors the latter thread and keeps it up-to-date so you need not worry about the binaries getting stale.

Aside from setting the JRE binary to /usr/bin/java (after you’ve done sudo apt install oracle-java8-jdk), the other pitfall for Ubuntu MATE users is that your default user isn’t necessarily pi. Hopefully when you edited runOptifine1_12_1.sh you search-and-replaced all instances of /home/pi with /home/$USER or ~. Otherwise, you would naturally receive an error of the form Could not find or load main class net.minecraft….

Other steps where you should exercise caution include selecting the correct version (1.12.1) in the launcher and downloading the matching version of OptiFine (in this case C5). However, these points apply to both Raspbian and Ubuntu MATE. If you want to use a newer version like 1.12.2 that’s possible if you follow the instructions carefully, but I’d recommend getting something up and running first.

1 Like

THANKYOU SOOOOOOOO MUCH jdonald!!! It works it really does. Whooooooooooo
Many thanks to you and terzag you both helped me incredibly!!! Now will you excuse me I am going to play some Minecraft. :smile: Hope to see you guys again in another forum. :wink:

1 Like

I will not answer your question, as I got too much hard time to make it ...never work properly.

On the over hand, do you know minetest?
I installed it on our home computers and my kids went crazy with this remake of Minecraft.

It's in the Ubuntu Software Center (search "minetest"), it works flawlessly, you might want to give it a try.
My kids never looked back to Minecraft.

Thanks Patrice ,but I think I would rather stick to Minecraft instead of a knock off. I might try it ,but the software center is so laggy so I had to get appgrid instead.

This isn’t really the case yet on a Pi 3, but you can get upwards of 40 fps with some hacking. That’s comparable to what’s possible with Minecraft Java Edition.

I’ve detailed some experiments regarding that on Stack Exchange: “Minetest extremely slow”

I haven' t gotten a chance to try this, but you should be able to run sudo apt-get install default-jre to install java, download the Linux version of the Minecraft Launcher, extract it, and run the included executable to launch the Minecraft Launcher?

Hi I have also faced the same error of Java.. I have used raspberry pi 2 last time which I got it from w11stop but then here in ubuntu I read a comment that we should install Raspberry pi 3 instead using Java.. I have purchased one and even tried but I got the same problem, it means that there is no difference between the Pi 2 & 3 using Java.

@wyatt_jackson: kinda, except default-jre points to Java 11 nowadays which isn't compatible on any working Minecraft Java setup yet. If you follow the updated scripts on the Pi forums, there are commands there that take care of installing the required JDK 8.

@ayesha_salman: Same error = "Error: Could not find or load main class net.minecraft.client.main.Main"? For Ubuntu MATE users most of the time this has been because the hardcoded scripts assumed the folder to be /home/pi while usernames on Ubuntu are different. You can solve this by either setting your username to pi or editing the scripts to match your username.

Though it's also an issue that his scripts were running all the way through rather than stopping on errors, so it was hard to diagnose the real cause of some problems. You can add #!/bin/sh -e at the top to get them to make sensible output failing earlier.