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

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

  1. OverkillLabs
    OP

    OverkillLabs Member

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    For this tutorial you need to have L4T Linux set up and updated.

    This is a simple guide(as simple as I could make it) to installing all necessary things to get Minecraft Java Edition up and running.

    I basically compiled a full version of various different tutorials I found scattered around that I used to make Minecraft work and play normally.


    • Open Terminal
    • Type all of the following stuff in Terminal

    Code:
    sudo apt update
    • Install the following dependencies:
    Code:
    sudo apt install openjdk-8-jdk
    sudo apt install gradle openjdk-8-jdk libx11-dev xorg-dev
    
    • Soft link libjawt
    Code:
    sudo ln -s /usr/lib/jvm/java-8-openjdk-arm64/lib/aarch64/libjawt.so /usr/lib/libjawt.so
    
    • Compile LWJGL
    Code:
    git clone https://github.com/LWJGL/lwjgl
    cd lwjgl
    ant generate-all
    ant compile_native
    
    • Copy Binaries
    Code:
    mkdir -p ~/.minecraft/natives
    cp ~/lwjgl/libs/linux/liblwjgl.so ~/.minecraft/natives/
    cp ~/lwjgl/libs/linux/libopenal.so ~/.minecraft/natives/
    
    • Setup environment variable (you need to run this command in terminal every time you close terminal and re-open it to launch Minecraft again otherwise the game will crash)
    Code:
    export _JAVA_OPTIONS='-Djava.library.path=/home/YOURUSERNAME/.minecraft/natives/'
    
    • Play Minecraft
    Code:
    wget https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar
    java -jar Minecraft.jar
    
    • Use your Minecraft Account to Login to the launcher
    • Choose the version you want to play in settings (has to be Minecraft 1.12.2 or lower, newer versions make the game crash)
    • Click Play and if you did everything right it should launch and play without a problem
    • NOTE: If you want to use Optifine with it just download the Optifine jar for your version (again 1.12.2 or lower) and run the following command and click install:
    Code:
    java -jar Optifine(version number).jar
    
    • Then when you start the Minecraft launcher again a new profile should come up named Optifine, just start Minecraft with that profile instead of your other one.
    • Also apparently if you type into Terminal "sudo jetson_clocks" it will give you more fps ingame? Not tested it yet.
     
    Last edited by OverkillLabs, Jun 25, 2019
  2. Menchen

    Menchen Newbie

    Newcomer
    1
    Apr 27, 2019
    Spain
    One advice, you can add java arg in minecraft launcher..
     
  3. RiceAlex

    RiceAlex Member

    Newcomer
    1
    May 6, 2019
    China
    the version of LWJGL you compile is 2.X or 3.X? Minecraft had moved their backend from LWJGL2 to LWJGL3 since 1.13.X , I only got LWJGL2 natives compiled,how is yours?
     
  4. OverkillLabs
    OP

    OverkillLabs Member

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    Mine is also only LWJGL2 hence why Minecraft up till version 1.12.2 runs only.
     
  5. RiceAlex

    RiceAlex Member

    Newcomer
    1
    May 6, 2019
    China
    The LWJGL3 is offcially released linux-arm64 nighty version,shipping the natives too,would you try it out? I currently don't have access to my Switch.
     
  6. OkazakiTheOtaku

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
    How well does this run, FPS wise?
     
  7. Menchen

    Menchen Newbie

    Newcomer
    1
    Apr 27, 2019
    Spain
    With optifine shuold be over 180fps if you "overclock"
     
    RiceAlex likes this.
  8. RiceAlex

    RiceAlex Member

    Newcomer
    1
    May 6, 2019
    China
    With sudo jetson_clocks it should work like this,btw fullscreen is broken in the version above 1.7.X , It will draw a 720x1280 framebuffer while the screen is 1280x720.
     
  9. OkazakiTheOtaku

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
    Do you know what optifine + standard clock looks like? At least 60?
     
  10. Menchen

    Menchen Newbie

    Newcomer
    1
    Apr 27, 2019
    Spain
    With a new world 80+ fps, I think.
     
  11. RiceAlex

    RiceAlex Member

    Newcomer
    1
    May 6, 2019
    China
    tested about 40fps barely playable
     
  12. OkazakiTheOtaku

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    9
    Jul 20, 2016
    Japan
    127.0.0.1
    Hm...I wouldn't agree that 40fps is "barely playable" considering a lot of games in Horizon run at ~30 but I digress. Interesting. I'm wondering how much you could squeeze out of a FTB pack with or without overclocking. Very interested in trying this with Sky Factory, for example, but I don't have a spare SD card on hand for L4T.
     
  13. OverkillLabs
    OP

    OverkillLabs Member

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    In my tests I usually get 60fps when there's not a lot of huge buildings or crazy stuff happening(With Optifine)
     
  14. Alex S

    Alex S Creator Of WWHDM, And Metroid Fusion XER0X!

    Member
    6
    May 2, 2016
    United States
    Hell
    is anyone else getting this when they go to compile lwjgl?
    i get this output right after running ant compile_native and any help would be wonderful.


    compile:
    [core] Compiling 249 source files to /home/alexs2412/lwjgl/bin
    [core] warning: [options] bootstrap class path not set in conjunction with -source 5
    [core] error: Source option 5 is no longer supported. Use 6 or later.
    [core] error: Target option 1.5 is no longer supported. Use 1.6 or later.
    BUILD FAILED
    /home/switch/lwjgl/build.xml:465: Compile failed; see the compiler error output for details.
     
  15. OverkillLabs
    OP

    OverkillLabs Member

    Newcomer
    1
    Jan 26, 2019
    Bulgaria
    Uninstall everything java related and reinstall it then it should fix itself and compile properly.
     
  16. Alex S

    Alex S Creator Of WWHDM, And Metroid Fusion XER0X!

    Member
    6
    May 2, 2016
    United States
    Hell
    erm... i uninstalled everything the tutorial installs and tried again and its the exact same issue.
     
  17. RiceAlex

    RiceAlex Member

    Newcomer
    1
    May 6, 2019
    China
    to compile LWJGL you need some dependecies
    Code:
    sudo apt-get install libxcursor-dev # X cursor management library (development files)
    sudo apt-get install libxxf86vm-dev # X11 XFree86 video mode extension library (development headers)
    sudo apt-get install libxrandr-dev  # X11 RandR extension library (development headers)
    sudo apt-get install libxt-dev      # X11 Toolkit Intrinsics library (development headers)
    and you must edit the build.xml:
    Before we compile, there is a bug in the LWJGL linux build that we need to fix first. In the file platform_build/linux_ant/build.xml you need to change this line (near the top):

    <property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/i386 -ljawt" />
    to be this instead: (just changing the i386 to aarch64)

    <property name="libs32" value="-L/usr/X11R6/lib -L/usr/X11/lib -lm -lX11 -lXext -lXcursor -lXrandr -lXxf86vm -lpthread -L${java.home}/lib/aarch64 -ljawt" />
    These are some compilation flags that ant passes to gcc when compiling.

    do same to the next line "libs64"

    — Posts automatically merged - Please don't double post! —

    The framerate is on the fly, the max is 40 fps most time it it is under 30 if you don't sudo jetson_clocks
     
    Last edited by RiceAlex, Jun 26, 2019
  18. Alex S

    Alex S Creator Of WWHDM, And Metroid Fusion XER0X!

    Member
    6
    May 2, 2016
    United States
    Hell
    problem is the compiler uses Buildfile: /home/switch/lwjgl/build.xml

    and not what you pointed to.
     
  19. Craftyawesome

    Craftyawesome GBAtemp Regular

    Member
    4
    Feb 3, 2018
    United States
    No, you have to uninstall java (11?) and reinstall java 8. Follow
    https://askubuntu.com/questions/84483/how-to-completely-uninstall-java
    And restart the tutorial from the beginning.

     
  20. Alex S

    Alex S Creator Of WWHDM, And Metroid Fusion XER0X!

    Member
    6
    May 2, 2016
    United States
    Hell
    i am using java 8 right now
    you didnt show how to install java 8... the guide installs java 11
     
Loading...