Hacking WIP [Tutorial] How to run Minecraft: Java Edition on the nintendo switch with linux

  • Thread starter Thread starter NekoNoor
  • Start date Start date
  • Views Views 43,289
  • Replies Replies 43
  • Likes Likes 5

NekoNoor

Well-Known Member
Newcomer
Joined
Oct 13, 2015
Messages
59
Reaction score
32
Trophies
0
XP
704
Country
Netherlands
THIS DOES NOT WORK YET! Scroll down to the bottom if you would like to help.

For this tutorial I am assuming you already have linux set up with the KDE + graphics acceleration rootfs.
If you haven't set it up. Check out how to do that in this thread: https://gbatemp.net/threads/quick-tuto-how-to-boot-linux-on-your-switch.501918/

This tutorial is based off an existing tutorial for the raspberry pi: https://www.raspberrypi.org/forums/viewtopic.php?t=186547
The run script isn't mine and was written by rogerallen, i have adapted it to work on the nintendo switch.

On SSH, run:
Code:
sudo pacman -Syu freealut jre9-openjdk jre8-openjdk wget jdk8-openjdk apache-ant base-devel
mkdir ~/Minecraft
mkdir ~/Minecraft/Natives
cd ~/Minecraft
wget https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar
sudo archlinux-java set java-9-openjdk

On the Switch, run:
Code:
cd ~/Minecraft
java -jar Minecraft.jar

Now you should see the Minecraft launcher, log in with your e-mail and password and press play (just be sure to select 1.12.2 as the version). It should download all the files it needs and crash, that's fine for now.

On SSH, run:
Code:
cd ~/Minecraft/Natives
wget https://gist.github.com/Seddigirl/05f2a409c014ee4b245d94cb21168923/raw/9129f2ab262199c30305a9d00714fb683100c54c/liblwjgl.so
wget https://gist.github.com/Seddigirl/05f2a409c014ee4b245d94cb21168923/raw/d11ce3b1794f25bb63e31887000c8eb578ec51d2/libopenal.so
cd ~/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl/2.9.4-nightly-20150209
rm lwjgl-2.9.4-nightly-20150209.jar
wget https://www.dropbox.com/s/mj15sz3bub4dmr6/lwjgl-2.9.4-nightly-20150209.jar

On the switch, open a browser, go to https://optifine.net/downloads and download OptiFine 1.12.2 HD U D2.

On the Switch, run:
Code:
cd ~/Downloads
java -jar OptiFine_1.12.2_HD_U_D2.jar

It should open the installer, click "install" and wait for it to complete.

On the Switch, run:
Code:
cd ~/Minecraft
java -jar Minecraft.jar

Press play (make sure the "OptiFine" profile is selected) it should download all the necessary files and crash.

On SSH, run:
Code:
cd ~/Minecraft
wget https://gist.githubusercontent.com/Seddigirl/036a578a070b85dd15775434746d8204/raw/1872a835cd2d36d51a79f142997307f760009538/runOptifine1_12_2.sh
sudo chmod +x runOptifine1_12_2.sh
sudo archlinux-java set java-8-openjdk

Edit runOptifine1_12_2.sh with the required information (dont forget the clienttoken and uuid which you can get from ~/.minecraft/launcher_profiles.json).

What you need to edit:
Code:
# !!! YOU MUST PERSONALIZE ALL OF THIS INFO !!!
# your personal login/password.  chmod 700 to keep this private
[email protected]
MINECRAFT_USERNAME=abcdefghi
MINECRAFT_PASSWORD=xxxxxxxx
# where did you store the native liblwjgl.so and libopenal.so?
MINECRAFT_NATIVE_PATH=~/Minecraft/Natives
# info from initial run data in .minecraft/launcher_profiles.json
MINECRAFT_CLIENTTOKEN=b61fb8e9-97bf-435f-8354-1feaba0ce734
MINECRAFT_UUID=12345678-1234-1234-1234-123456789abc
MINECRAFT_VERSION=1.12

This should be everything you need to run Minecraft: Java Edition on the Nintendo Switch!

On the Switch, run:
Code:
cd ~/Minecraft
./runOptifine1_12_2.sh

This is the part where i need your help:

When running minecraft after it has loaded everything and the window pops up, i get an error saying:
Code:
X Error - disp: 0xffffaca68080 serial: 79 error: BadPixmap (invalid Pixmap parameter) request_code: 54 minor_code: 0

Full error log: https://gist.github.com/Seddigirl/f3f673cc3f3bc5b198019e37564595f9

I think this might have something to do with the way i compiled LWJGL, for more info on how to compile lwjgl yourself for the nintendo switch check here: https://github.com/LWJGL/lwjgl/issues/74 and here: http://rogerallen.github.io/jetson/2014/07/31/minecraft-on-jetson-tk1/

Just clone this: https://github.com/Seddigirl/lwjgl and symlink libjawt.so like this:

Code:
ln -s /usr/lib/jvm/java-8-openjdk/lib/aarch64/libjawt.so /usr/lib/libjawt.so

LWJGL2 should now compile properly on the nintendo switch.

Just run:
Code:
ant generate-all
ant compile
ant compile_native

And it should compile properly

We need to figure out what's causing the X Error on launch. I think it might have something to do with how lwjgl is compiled but i'm not sure. It could have something to do with the graphics drivers too.
 
Last edited by NekoNoor,
I already tried to run minecraft as well. The problem I have is that the JVM crashes :/
I also had to compile that library and I did it successfully.

I have read that the ARM oracle VM is buggy so we have to use Jam VM instead.
 
  • Like
Reactions: The9thBit
I already tried to run minecraft as well. The problem I have is that the JVM crashes :/
I also had to compile that library and I did it successfully.

I have read that the ARM oracle VM is buggy so we have to use Jam VM instead.

I am not using the oracle VM, i'm using the openjdk vm, the jvm doesnt crash for me and the issue i'm having is described in the main post.
 
IF you can even get this to work would the switch even be able to run the java version of minecraft without like exploding? XD
 
IF you can even get this to work would the switch even be able to run the java version of minecraft without like exploding? XD
Actually, it would result in a chain reaction efficient enough to swipe the Northern Hemisphere away, turning the Earth into a very watery Semisphere... (?)
 
IF you can even get this to work would the switch even be able to run the java version of minecraft without like exploding? XD
The Switch has 4GB of RAM. So if Minecraft can run on the 360 with only 512MB RAM, then the Switch can handle regular (Java) Minecraft.
 
The sheer thought of potentially being able to play Roblox on a official Nintendo console sends chills down my spine. (No offense to Roblox players, this is more of a playfully joking comment. Also DOES having Linux and running wine give potential to play full fledged PC games? Or can we also utilize Windows too at some point?)
 
  • Like
Reactions: Tizm
The Switch has 4GB of RAM. So if Minecraft can run on the 360 with only 512MB RAM, then the Switch can handle regular (Java) Minecraft.
Every console is running Minecraft C++, not Minecraft Java. The Java version is horribly optimised. It should still run fine with the Switch's specs, though.
 
Every console is running Minecraft C++, not Minecraft Java. The Java version is horribly optimised. It should still run fine with the Switch's specs, though.
Ah, thanks for clearing that up for me. But yeah, I have faith it can handle the java version just fine. Probably a few light mods too without much trouble, but nothing like shaders or crazy 512x512 texturepacks. Maybe packs like Faithful x32.
 
  • Like
Reactions: smileyhead
The sheer thought of potentially being able to play Roblox on a official Nintendo console sends chills down my spine. (No offense to Roblox players, this is more of a playfully joking comment. Also DOES having Linux and running wine give potential to play full fledged PC games? Or can we also utilize Windows too at some point?)
Wine is not going to run Windows apps wine is not an emulator it doesn't not emulate x86 or x64
 
  • Like
Reactions: orangy57 and nmkd
Dunno if it can help ya, but in the AUR repositories (yaourt should be the package manager if nothing has changed since I used Arch) you can find lwjgl2: https://aur.archlinux.org/packages/lwjgl2/

That downloads the libraries built for x86 platforms. it downloads it from https://downloads.sourceforge.net/project/java-game-lib/Official Releases/LWJGL 2.9.3/lwjgl-2.9.3.zip

could you try sudo snap install minecraft

make sure you have snapd
The problem isnt that i cant install minecraft, the snap downloads a package which includes the x86 libraries. those dont work on the switch

IF you can even get this to work would the switch even be able to run the java version of minecraft without like exploding? XD

A raspberry pi 3 can run the game just fine with ~30fps if you lower all the settings
 
Last edited by NekoNoor,
  • Like
Reactions: nmkd
The sheer thought of potentially being able to play Roblox on a official Nintendo console sends chills down my spine. (No offense to Roblox players, this is more of a playfully joking comment. Also DOES having Linux and running wine give potential to play full fledged PC games? Or can we also utilize Windows too at some point?)
No, it does not. The reason why Minecraft and other Java-based applications might work is because it is compiled to run under a Java Virtual Machine so assuming a JVM-implementation is readily available on your platform and there aren't any issues with other dependencies needed it should work.

What this doesn't do is emulate another CPU architecture which is what you would need to do to run x86-based software on an ARM-based CPU.
 
The sheer thought of potentially being able to play Roblox on a official Nintendo console sends chills down my spine. (No offense to Roblox players, this is more of a playfully joking comment. Also DOES having Linux and running wine give potential to play full fledged PC games? Or can we also utilize Windows too at some point?)

Wine is not going to run Windows apps wine is not an emulator it doesn't not emulate x86 or x64

No, it does not. The reason why Minecraft and other Java-based applications might work is because it is compiled to run under a Java Virtual Machine so assuming a JVM-implementation is readily available on your platform and there aren't any issues with other dependencies needed it should work.

What this doesn't do is emulate another CPU architecture which is what you would need to do to run x86-based software on an ARM-based CPU.

Please create a different thread if you would like to discuss running x86 programs through wine on the switch
 
Please create a different thread if you would like to discuss running x86 programs through wine on the switch
We are simply explaining why this topic of yours does not imply what this user thinks. There is no intention to start a discussion about such a thing as that would be completely offtopic.
 
We are simply explaining why this topic of yours does not imply what this user thinks. There is no intention to start a discussion about such a thing as that would be completely offtopic.
Ah yeah that makes sense, apologies.
 
I already tried to run minecraft as well. The problem I have is that the JVM crashes :/
I also had to compile that library and I did it successfully.

I have read that the ARM oracle VM is buggy so we have to use Jam VM instead.
Cool! I remember doing this on the Pi 3!
 
  • Like
Reactions: coppertj
IF you can even get this to work would the switch even be able to run the java version of minecraft without like exploding? XD

People have done this on a RPi, Switch could easily handle PC Minecraft at low settings.
 

Site & Scene News

Popular threads in this forum