How To Play Minecraft Java Edition On L4T Linux [Tutorial]

Discussion in 'Switch - Tutorials' started by OverkillLabs, Jun 24, 2019.

  1. Crimson Cuttlefish

    Crimson Cuttlefish GBAtemp Regular

    Member
    5
    Aug 15, 2016
    United States
    How good do you think the Switch would be for running a server?
     
  2. Menchen

    Menchen Newbie

    Newcomer
    1
    Apr 27, 2019
    Spain
    20 people shuold be ok in the switch... although raspberry pi 4 ,4g ram model shuold act similarly..
     
  3. Hambrew

    Hambrew GBAtemp Regular

    Member
    3
    Oct 9, 2018
    United States
    I get it if I don't understand that "that's not how it works", but can you compile LWJGL3 instead of LWJGL2 to get 1.13 and up working? :)
     
  4. OverkillLabs
    OP

    OverkillLabs Member

    Newcomer
    2
    Jan 26, 2019
    Bulgaria
    I'm trying to make LWJGL3 work but's constantly crashing in newer minecraft versions. I'll see if I can make it work and run somehow.
     
  5. Canberk

    Canberk Newbie

    Newcomer
    1
    Jul 1, 2019
    Canada
    I was able to compile LWJGL3 - here are my files! I was able to successfully launch Minecraft 1.14.3 by putting these files in ~/.minecraft/natives and following OP
     

    Attached Files:

  6. crabycowman123

    crabycowman123 Member

    Newcomer
    2
    Nov 14, 2018
    United States
    Anyone know what this error means?

    Picked up _JAVA_OPTIONS: -Djava.library.path=/home/jacob/.minecraft/natives/
    OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    Exception in thread "main" java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getPointerSize()I
    at org.lwjgl.DefaultSysImplementation.getPointerSize(Native Method)
    at org.lwjgl.Sys.<clinit>(Sys.java:118)
    at bib.I(SourceFile:2825)
    at net.minecraft.client.main.Main.main(SourceFile:38)

     
  7. Hamdan

    Hamdan GBAtemp Regular

    Member
    4
    Dec 14, 2018
    Pakistan
    Here is how to setup environment variable permanently:

    • Open a terminal window with Ctrl+Alt+T.
    • Open the file for editing with

      gedit ~/.profile

    • Add this to bottom
    export _JAVA_OPTIONS='-Djava.library.path=/home/YOURUSERNAME/.minecraft/natives/'
    • save and exit
    • Log out and log in again.
     
    Last edited by Hamdan, Jul 7, 2019
    OverkillLabs likes this.
  8. EncryptedKitten

    EncryptedKitten Newbie

    Newcomer
    1
    Jul 9, 2019
    United States
    I got the MultiMC launcher to work. This is mostly pulled from the MultiMC build documentation. To build it run:

    Code:
    git clone (MultiMC5 git repo on github I cant post links)
    cd MultiMC5
    git submodule init
    git submodule update
    sudo apt install gcc qt5-default cmake zlib1g-dev openjdk-8-jdk libgl1-mesa-dev
    mkdir build
    mkdir install
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=../install ..
    make -j4 install
    To run MultiMC:
    Code:
    cd ../install
    ./MultiMC
    To run Minecraft in MultiMC it does not accept the java libraries path argument (it just ignores it) but if you stop the java process immediately and replace the natives in the instance dir/natives, and then resume the java process it will launch. I created a set of python scripts to do this automatically, but they wont work if other java programs are running, and will crash if the instance is running for the first time, because the first time you launch a MultiMC instance it create a file that it need to read to find the lwjgl version. Just add:

    Code:
    python3 WHEREVER_THE_SCRIPTS_ARE/copynativeslauncher.py $INST_DIR
    to the custom commands Pre-launch command and it will run on launch. In the folder with the scripts there is a conf.json file to specify the lwjgl paths. If you are only planning on using one lwjgl version, you can remove the other one leave it as the default or blank.

    Also if anyone knows how to fix the lwjgl3 error:
    Code:
    [Client thread/INFO]: [STDERR]: [LWJGL] [ERROR] Incompatible Java and native library versions detected.
    Possible reasons:
       a) -Djava.library.path is set to a folder containing shared libraries of an older LWJGL version.
       b) The classpath contains jar files of an older LWJGL version.
    Possible solutions:
       a) Make sure to not set -Djava.library.path (it is not needed for developing with LWJGL 3) or make
          sure the folder it points to contains the shared libraries of the correct LWJGL version.
       b) Check the classpath and make sure to only have jar files of the same LWJGL version in it.
    For using controllers in Minecraft you can use QJoyPad. To install it:
    Code:
    sudo apt install qjoypad
    And to run it:
    Code:
    qjoypad --notray
     

    Attached Files:

    Last edited by EncryptedKitten, Jul 11, 2019
  9. ShinkoNet

    ShinkoNet Obsessed with Touhou

    Member
    2
    Dec 1, 2013
    What did you do to compile it? I'm getting "incompatible Java and native library versions detected" when using those files in the .minecraft/natives/ folder.

    I did build lwjgl2 earlier to get 1.12.2 working, if that gives any more info. I completely switched out the natives folder to test, though

    Also, Forge 1.12 seems to crash when using the Controllables mod, since I prefer it over qjoypad... It also seems that the Joypad + Split Screen mod doesn't detect any controllers at all.

    Anyway, to get inventory scrolling working with qjoypad, you need to install 'xdotool' and 'xbindkeys'.
    Then in ~/.xbindkeysrc type:
    Code:
    "xdotool mousedown 3"
    (desired key)
    
    "xdotool mousedown 4"
    (desired key)
    with the (desired key) being bound to the controller via qjoypad. 3 is up, 4 is down.
     
    Last edited by ShinkoNet, Jul 14, 2019
  10. NicholasCullihal

    NicholasCullihal GBAtemp Regular

    Member
    6
    Jul 28, 2012
    Canada
    @Canberk @ShinkoNet anyone manage to get liblwjgl to work with optifine 1.14.3, mine crashes a second after the game launches with this error
    Warning: Spoilers inside!
    i cannot for the life of me figure out how @Canberk got his game to load
     
  11. Hamdan

    Hamdan GBAtemp Regular

    Member
    4
    Dec 14, 2018
    Pakistan
    Ditto, could @Canberk please help?
     
  12. Eeveekid

    Eeveekid GBAtemp Regular

    Member
    4
    Jul 31, 2018
    Germany
    can someone make an video tutorial to how to do it?
     
  13. Eeveekid

    Eeveekid GBAtemp Regular

    Member
    4
    Jul 31, 2018
    Germany
    how do i install mods?
     
  14. Canberk

    Canberk Newbie

    Newcomer
    1
    Jul 1, 2019
    Canada
    sorry I missed all the messages, I didn't get notified for some reason. I ended up deleting L4T in favor of Android but I still have some things that may be of help. one thing you'll want to keep in mind is that these files must replace the files in OP, not be alongside them. your natives folder must only have what I have in the archive above. I made numerous changes in lwjgl3's source and built it straight from the Switch in order to get what is in the above archive. I wish I remembered what changes I made (or I backed it up before wiping L4T away), but this is sadly all the information I have.

    I used this bash script to launch Minecraft 1.14.3 (afaik, also try 1.14.2 to be safe) and I have noticed that it does NOT work with any later version. put the Minecraft launcher inside ~/minecraft.jar (~ represents your home directory), copy the script that starts with "#!/bin/bash" (it is the entirety of the three lines which go to the end of the post) into a file with the ".sh" extension, and open a terminal. type "chmod +x " into the terminal (with the space at the end) and drag this script into your terminal window. now you may be able to double-click the script (or drag it to the terminal window without anything typed in it) to launch Minecraft!

    I got a ton of "Incompatible Java and native library versions detected" from lwjgl but I merely ignored them and the game played perfectly fine.

    I don't know what sort of problems you guys are having with Optifine as I had it working perfectly fine (in fact, I even tried my roommate's Switch to make sure!). Please let me know if you still have trouble and I'll try to help as much as I can!

    #!/bin/bash
    export _JAVA_OPTIONS="-Djava.library.path=$HOME/.minecraft/natives/"
    java -jar ~/minecraft.jar
     
    Last edited by Canberk, Aug 2, 2019
  15. smitty96

    smitty96 Member

    Newcomer
    2
    May 16, 2009
    United States
    New Jersey
    Hey, thanks for coming back to help! It's a shame you don't have your changes to the libraries anywhere, I was interested to see what you did to get them to compile.

    On my Switch I'm still not able to run any version of 1.4, but it does look like 1.4.2 and lower get a little bit farther than 1.4.3 and up. On 1.4.2 I get the incompatible native versions error, and after that message it says the fatal error is a SIGSEGV. On 1.4.3 and 1.4.4 the fatal error just says "Internal Error." Best I can tell from the log is that the problem in 1.4.2 is something with libglfw. I could upload my log files if you think you'd be able to glean more from them than I can.
     
  16. Centergaming

    Centergaming GBAtemp Advanced Fan

    Member
    6
    Apr 17, 2016
    United States
    Running into this same issue but don’t know how to fix it without reinstalling Linux :(

    Edit: I found a solution! I actually add to do “sudo apt purge “program”” for the ones that I installed during this tutorial, I then had to do “sudo rm /usr/lib/libjawt.so” and redid the tutorial and now it works perfectly.
     
    Last edited by Centergaming, Aug 11, 2019
  17. Centergaming

    Centergaming GBAtemp Advanced Fan

    Member
    6
    Apr 17, 2016
    United States
    Hi, mind sending the binaries please? For some reason it keeps erroring out saying “recipe for target ‘alreverb’ failed” :/

    Edit: Nvm, solved it. I actually had to download the latest OpenAL from their github and then it compiled with no issues.
     
    Last edited by Centergaming, Aug 11, 2019
  18. Canberk

    Canberk Newbie

    Newcomer
    1
    Jul 1, 2019
    Canada
    The majority of my changes were changing amd64 to arm64 (or aarch64, I can't remember). I remember running ack (basically recursive grep) to find all references to x86 and amd64 which I would end up changing to arm64 (or aarch64). I may have also had to make a few other changes, it took a good few days to figure it all out and it's sadly really not fresh in my memory. Such a shame I forgot to back the source up...

    I am completely baffled that it just doesn't work for you guys, I'll take a look at what I did and compare it to OP. I tested it on two switches before I posted my files...

    EDIT: I went back to my roommate's switch which thankfully still had L4T installed. Turns out I'm an idiot. I used OpenJDK 11 instead of 8 on both my test switches, that's why it works for me and not you guys. Perhaps try again after running "sudo apt purge openjdk-8-jdk && sudo apt install openjdk-11-jdk" in your terminal, without the quotes? I also don't see /usr/lib/libjawt.so as OP suggests so experiment both with and without the file being present. Just don't forget that the symlink will likely break after running the above command so you may find it beneficial to remove and re-link it.
     
    Last edited by Canberk, Aug 12, 2019
  19. miturka

    miturka Newbie

    Newcomer
    1
    Dec 12, 2018
    Slovakia
    I also got the error, can you please explain what exactly u did?
     
  20. Centergaming

    Centergaming GBAtemp Advanced Fan

    Member
    6
    Apr 17, 2016
    United States
    I just told the solution for my Edit... All I did was remove the programs that I installed during this tutorial using the "sudo apt purge (insert program name)", then I did "sudo rm /usr/lib/libjawt.so" and I started the tutorial from the beginning.
     
Quick Reply
Draft saved Draft deleted
Loading...