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

Centergaming

Well-Known Member
Member
Joined
Apr 17, 2016
Messages
695
Trophies
0
XP
923
Country
United States
I believe that's a issue in the X server configuration

How are you able to fix this issue if you don't mind me asking? :)

--------------------- MERGED ---------------------------

Photo is totally fake.... or not....
IMG_2098.JPG
 

Yo_Homie

Member
Newcomer
Joined
Dec 31, 2018
Messages
20
Trophies
0
Age
29
XP
102
Country
United States
I have been trying to get Minecraft to work on Ubuntu on the Switch. Ran into a linux.display.create error. eventually gave up. Here is my liblwjgl.so if you wanna try it with Arch.
 

Attachments

  • liblwjgl.zip
    83.1 KB · Views: 125
Last edited by Yo_Homie,

Xolono

Member
Newcomer
Joined
Apr 11, 2017
Messages
21
Trophies
0
Age
25
XP
244
Country
I installed L4T to mess around with it, I'll see if I can get it working on L4T
Hey there, I've also tried messing around with this, but my patience isn't great. Some people also said to try these steps, haven't had the chance to yet.
Hopefully this helps

"for the switch you need to compile LWJGL for arm64 as thats the only binary not letting MC run. I tried doing so but still no luck getting it to run. Search ChromeOS forums for this rather rpi as most rpis run 32-bit OSes rather 64-bit"
"Minecraft only provides the libraries it needs for x86 systems, you'll probably have to compile them yourself for 64-bit ARM and convince the launcher to use them if you want to play Minecraft."
 

Artur95

Member
Newcomer
Joined
Sep 11, 2018
Messages
24
Trophies
0
Age
26
Location
Deutschland
XP
635
Country
Germany
But why does it run on a raspberry pi that is ARM too?

Edit: nevermind, im dumb
Hey there, I've also tried messing around with this, but my patience isn't great. Some people also said to try these steps, haven't had the chance to yet.
Hopefully this helps

"for the switch you need to compile LWJGL for arm64 as thats the only binary not letting MC run. I tried doing so but still no luck getting it to run. Search ChromeOS forums for this rather rpi as most rpis run 32-bit OSes rather 64-bit"
"Minecraft only provides the libraries it needs for x86 systems, you'll probably have to compile them yourself for 64-bit ARM and convince the launcher to use them if you want to play Minecraft."
 
Last edited by Artur95,

Yo_Homie

Member
Newcomer
Joined
Dec 31, 2018
Messages
20
Trophies
0
Age
29
XP
102
Country
United States
I finally managed to get different errors. I can't tell if it is further along than what NekoNoor got or not. Here is my log:
 

Attachments

  • latest.log.txt
    9.7 KB · Views: 159
Last edited by Yo_Homie,

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
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?)

What you refer to as "PC" would be more adequeately described as the x86/amd64 architecture. The switch has a decent set of specs - enough to play "PC" games, but running games for an intel architecture through QEMU/whatever isn't using a hypervisor, but emulation.

wine-hangover can achieve decent performance with some DirectX9 and OpenGL games, but isn't yet complete. Hangover effectively translates the graphics APIs to the native host and runs the rest through qemu, so there's still CPU overhead but GPU overhead is close to nonexistent.

Using purely emulation the most you'll manage is running visual novels at an extremely slow speed. Software rendering is unfortunately disgustingly slow whether it's Windows' reference renderer or llvmpipe.

I believe that's a issue in the X server configuration

Tiny edit; I've seen three situations in which this occurs, generally.
  1. ABI breakage (e.g. libraries are linked using incompatible versions and fail to work at runtime)
  2. Missing X11 cookies (but usually, this isn't a PixmapError)
  3. Broken Xorg. Unlikely here since you have a desktop.
All-in-all, considering y'all seem to be sharing random shared objects instead of building the relevant libraries on a switch with build-essential and openjdk installed, ABI breakage seems most likely to me here.
 
Last edited by chaoskagami,

Yo_Homie

Member
Newcomer
Joined
Dec 31, 2018
Messages
20
Trophies
0
Age
29
XP
102
Country
United States
What you refer to as "PC" would be more adequeately described as the x86/amd64 architecture. The switch has a decent set of specs - enough to play "PC" games, but running games for an intel architecture through QEMU/whatever isn't using a hypervisor, but emulation.

wine-hangover can achieve decent performance with some DirectX9 and OpenGL games, but isn't yet complete. Hangover effectively translates the graphics APIs to the native host and runs the rest through qemu, so there's still CPU overhead but GPU overhead is close to nonexistent.

Using purely emulation the most you'll manage is running visual novels at an extremely slow speed. Software rendering is unfortunately disgustingly slow whether it's Windows' reference renderer or llvmpipe.



Tiny edit; I've seen three situations in which this occurs, generally.
  1. ABI breakage (e.g. libraries are linked using incompatible versions and fail to work at runtime)
  2. Missing X11 cookies (but usually, this isn't a PixmapError)
  3. Broken Xorg. Unlikely here since you have a desktop.
All-in-all, considering y'all seem to be sharing random shared objects instead of building the relevant libraries on a switch with build-essential and openjdk installed, ABI breakage seems most likely to me here.

Yes, I really have no idea what I should be doing to fix this. Guess I’ll be looking at what an ABI is this afternoon.

P.S- Is there anyone here who is a little more familiar with java/lwjgl that could give some help (like a lot ).
 
Last edited by Yo_Homie,

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Yes, I really have no idea what I should be doing to fix this. Guess I’ll be looking at what an ABI is this afternoon.

P.S- Is there anyone here who is a little more familiar with java/lwjgl that could give some help (like a lot ).

Application Binary Interface, which is in contrast to API (Application Programming Interface, e.g. headers)

Essentially, say a game loads SDL or equivalent to draw graphics. However, a recent version of this library changed a structure's format. The game accesses this structure directly when it should not, according to the documentation. As a result, the two things do not agree on what this structure is and it gets screwed up in memory, resulting in undefined behavior.

In a nutshell, that's what ABI breakage is. If both were recompiled, the problem would go away (because API is still compatible), but using two binaries that weren't compiled against compatible API versions causes misbehavior that's often difficult to detect (ABI breakage.)

What you should do to fix this is basically recompile everything Minecraft uses, on the target OS (Switch, Ubuntu or whatever distro you're running), in dependency order. You also need to make a custom profile for Minecraft in the launcher and override the libraries so it doesn't fall back on the ones Mojang provides, because those are unlikely to be compatible.
 
Last edited by chaoskagami,

Yo_Homie

Member
Newcomer
Joined
Dec 31, 2018
Messages
20
Trophies
0
Age
29
XP
102
Country
United States
Application Binary Interface, which is in contrast to API (Application Programming Interface, e.g. headers)

Essentially, say a game loads SDL or equivalent to draw graphics. However, a recent version of this library changed a structure's format. The game accesses this structure directly when it should not, according to the documentation. As a result, the two things do not agree on what this structure is and it gets screwed up in memory, resulting in undefined behavior.

In a nutshell, that's what ABI breakage is. If both were recompiled, the problem would go away (because API is still compatible), but using two binaries that weren't compiled against compatible API versions causes misbehavior that's often difficult to detect (ABI breakage.)

What you should do to fix this is basically recompile everything Minecraft uses, on the target OS (Switch, Ubuntu or whatever distro you're running), in dependency order. You also need to make a custom profile for Minecraft in the launcher and override the libraries so it doesn't fall back on the ones Mojang provides, because those are unlikely to be compatible.

Thank you for the great explanation! It would make sense to recompile everything it uses, but I sadly do not have the time nor skills to do that. I also think that the script used to load the game and all of its libraries, loads them all directly. That is why you have to capture the output from the (Default) launcher in the terminal and re-run it using the script with different libraries, making it not necessary to create a profile. When running it on the raspberry pi, I only had to use a special lwjgl.so and openal.so recompiled for that arm platform - That is why I figured all I would need to recompile is lwjgl for the switch and (provided the right modified run script and a proper version of java) it should be able to run. Obviously I was wrong. I'm not very familiar with Java or OpenGL or most things related to it; I just thought it would be cool to have Minecraft java running natively on the Nintendo Switch, but most of this is above my head. :(
 
Last edited by Yo_Homie,

chaoskagami

G̷̘̫̍̈́̊̓̈l̴̙͔̞͠i̵̳͊ţ̸̙͇͒̓c̵̬̪̯̥̳͒͌̚h̵̹̭͛̒̊̽̚
Developer
Joined
Mar 26, 2016
Messages
1,365
Trophies
1
Location
↑↑↓↓←→←→BA
Website
github.com
XP
2,287
Country
United States
Thank you for the great explanation! It would make sense to recompile everything it uses, but I sadly do not have the time nor skills to do that. I also think that the script used to load the game and all of its libraries, loads them all directly. That is why you have to capture the output from the (Default) launcher in the terminal and re-run it using the script with different libraries, making it not necessary to create a profile. When running it on the raspberry pi, I only had to use a special lwjgl.so and openal.so recompiled for that arm platform - That is why I figured all I would need to recompile is lwjgl for the switch and (provided the right modified run script and a proper version of java) it should be able to run. Obviously I was wrong. I'm not very familiar with Java or OpenGL or most things related to it; I just thought it would be cool to have Minecraft java running natively on the Nintendo Switch, but most of this is above my head. :(

An old Minecraft ebuild that no longer works in Gentoo provided a shell script wrapper around java that would modify the java classpath it received to redirect everything to system libraries. If you can still override what version of java to use, you can probably still pull something similar. Minecraft has to pass all the java libraries to java in the argument list.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: *yawn*