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

NekoNoor

Well-Known Member
OP
Newcomer
Joined
Oct 13, 2015
Messages
59
Trophies
0
XP
684
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,

PabloMK7

Red Yoshi! ^ω^
Developer
Joined
Feb 21, 2014
Messages
2,626
Trophies
2
Age
25
Location
Yoshi's Island
XP
5,435
Country
Spain
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

NekoNoor

Well-Known Member
OP
Newcomer
Joined
Oct 13, 2015
Messages
59
Trophies
0
XP
684
Country
Netherlands
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.
 
D

Deleted User

Guest
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
 

sarkwalvein

There's hope for a Xenosaga port.
Member
Joined
Jun 29, 2007
Messages
8,614
Trophies
2
Age
41
Location
Niedersachsen
XP
11,602
Country
Germany
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... (?)
 

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
13,638
Trophies
7
Location
WA State
Website
ko-fi.com
XP
18,467
Country
United States
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.
 

MochaMilk

That one weird Furry Artist
Member
Joined
Apr 21, 2015
Messages
595
Trophies
0
Age
27
Location
Your Fridge
XP
2,446
Country
United States
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

smileyhead

I like cute stuff.
Member
Joined
Aug 31, 2015
Messages
4,828
Trophies
4
Age
24
Location
Budakeszi, Hungary
Website
sites.google.com
XP
10,907
Country
Hungary
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.
 

Jayro

MediCat USB Dev
Developer
Joined
Jul 23, 2012
Messages
13,638
Trophies
7
Location
WA State
Website
ko-fi.com
XP
18,467
Country
United States
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

tunip3

[debugger active]
Banned
Joined
Oct 31, 2016
Messages
1,675
Trophies
0
XP
1,661
Country
United Kingdom
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

NekoNoor

Well-Known Member
OP
Newcomer
Joined
Oct 13, 2015
Messages
59
Trophies
0
XP
684
Country
Netherlands
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

Minox

Thanks for the fish
Former Staff
Joined
Aug 27, 2007
Messages
7,007
Trophies
2
XP
6,227
Country
Japan
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.
 

NekoNoor

Well-Known Member
OP
Newcomer
Joined
Oct 13, 2015
Messages
59
Trophies
0
XP
684
Country
Netherlands
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
 

Minox

Thanks for the fish
Former Staff
Joined
Aug 27, 2007
Messages
7,007
Trophies
2
XP
6,227
Country
Japan
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.
 

NekoNoor

Well-Known Member
OP
Newcomer
Joined
Oct 13, 2015
Messages
59
Trophies
0
XP
684
Country
Netherlands
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.
 

Hipeopeo

Well-Known Member
Newcomer
Joined
Apr 22, 2017
Messages
69
Trophies
0
Age
29
Location
Pretty Much Hell
Website
hipeopeo.tk
XP
192
Country
United States
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

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Plazorn @ Plazorn: did you perhaps, leave it on a coat hanger @Xdqwerty?