Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
356 stars 81 forks source link

(Mac) java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib #76

Closed BillBodkin closed 2 years ago

BillBodkin commented 3 years ago

Using the sample code from NPM on a Mac creates this error when launching the game (1.14 vanilla). The native files are being downloaded by the launcher into minecraft/natives/1.14

Have tried specifying the path using -Djava.library.path and also tried using chmod to make the files executable.

I have pasted the full error below:

// Why is it breaking :(

Time: 10/07/2021, 22:09
Description: Initializing game

java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib
        at org.lwjgl.system.Library.loadSystem(Library.java:147)
        at org.lwjgl.system.Library.loadSystem(Library.java:67)
        at org.lwjgl.system.Library.<clinit>(Library.java:50)
        at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
        at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
        at cub.a(SourceFile:106)
        at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
        at cvi.av(SourceFile:459)
        at cvi.b(SourceFile:395)
        at net.minecraft.client.main.Main.main(SourceFile:154)

A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
        at org.lwjgl.system.Library.loadSystem(Library.java:147)
        at rg.lwjgl.system.Library.loadSystem(Library.java:67)
        at org.lwjgl.system.Library.<clinit>(Library.java:50)
        at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:97)
        at org.lwjgl.system.Pointer$Default.<clinit>(Pointer.java:61)
        at cub.a(SourceFile:106)
        at com.mojang.blaze3d.platform.GLX.initGlfw(SourceFile:191)
        at cvi.av(SourceFile:459)

-- Initialization --
Details:
Stacktrace:
        at cvi.b(SourceFile:395)
        at net.minecraft.client.main.Main.main(SourceFile:154)

-- System Details --
Details:
        Minecraft Version: 1.14
        Operating System: Mac OS X (aarch64) version 11.4
        Java Version: 16.0.1, Azul Systems, Inc.
        Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Azul Systems, Inc.
        Memory: 3925952392 bytes (3744 MB) / 4294967296 bytes (4096 MB) up to 6442450944 bytes (6144 MB)
        JVM Flags: 4 total; -XX:-UseAdaptiveSizePolicy -XX:-OmitStackTraceInFastThrow -Xmx6G -Xms4G
        Launched Version: 1.14
        LWJGL: 3.2.1 build 12
        OpenGL: ~~ERROR~~ NoClassDefFoundError: Could not initialize class org.lwjgl.system.Library
        GL Caps:
        Using VBOs: Yes
        Is Modded: Probably not. Jar signature remains and client brand is untouched.
        Type: Client (map_client.txt)
        Resource Packs:
        Current Language: ~~ERROR~~ NullPointerException: Cannot invoke "dve.b()" because "this.ax" is null
        CPU: <unknown>

#@!@# Game crashed! Crash report saved to: #@!@# /Users/tomaz/Haven/cablepost-test/minecraft/crash-reports/crash-2021-07-10_22.09.09-client.txt
BillBodkin commented 3 years ago

For anyone having the same issue, thanks to Hanro50#5000 we tested using the Java version bundled with the official Minecraft launcher and found it to work.

(I think) The issue was that the version of Java it was using before was ARM but the files it was trying to load were not. The Java version included in the official launcher was x86_64

See here for a link to the relevant Discord messages