LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.67k stars 628 forks source link

Minecraft crash - LWJGL unable to locate liblwjgl.dylib #838

Closed meawplex-plus closed 1 year ago

meawplex-plus commented 1 year ago

Version

3.3.1

Platform

macOS arm64

JDK

Zulu OpenJDK 19.0.1

Module

LWJGL core (natives)

Bug description

Was trying to launch Minecraft when LWJGL raised an error of Failed to load a library.. Looked down the crash log and found that the root issue was a java.lang.UnsatisfiedLinkError while java/LWJGL attempted to locate the liblwjgl.dylib.

Any ideas?

(The Java is 64-bit, but hasn't been signed as such. You'll notice the)

Stacktrace or crash log output

MultiMC version: 0.6.16-3434

Launched instance in online mode

authserver.mojang.com resolves to:
    [18.172.117.46, 18.172.117.34, 18.172.117.60, 18.172.117.47]

session.minecraft.net resolves to:
    [34.197.32.8, 100.24.172.95, 35.153.153.200]

textures.minecraft.net resolves to:
    [2620:1ec:bdf::51, 2620:1ec:46::51, 13.107.246.51, 13.107.213.51]

api.mojang.com resolves to:
    [18.160.225.124, 18.160.225.73, 18.160.225.120, 18.160.225.40]

Minecraft folder is:
/Applications/MultiMC 2.app/Data/instances/omg rlly-/.minecraft

Java path is:
/usr/bin/java

Checking Java version...
Java is version 19.0.1, using 32-bit architecture, from Azul Systems, Inc..

Your Java architecture is not matching your system architecture. You might want to install a 64bit Java version.

Main Class:
  net.minecraft.client.main.Main

Native path:
  /Applications/MultiMC 2.app/Data/instances/omg rlly-/natives

Traits:
traits XR:Initial
traits FirstThreadOnMacOS

Libraries:
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1.jar
  /Applications/MultiMC 2.app/Data/libraries/ca/weblite/java-objc-bridge/1.1/java-objc-bridge-1.1.jar
  /Applications/MultiMC 2.app/Data/libraries/com/github/oshi/oshi-core/6.2.2/oshi-core-6.2.2.jar
  /Applications/MultiMC 2.app/Data/libraries/com/google/code/gson/gson/2.10/gson-2.10.jar
  /Applications/MultiMC 2.app/Data/libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
  /Applications/MultiMC 2.app/Data/libraries/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar
  /Applications/MultiMC 2.app/Data/libraries/com/ibm/icu/icu4j/71.1/icu4j-71.1.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/authlib/3.16.29/authlib-3.16.29.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/javabridge/2.0.25/javabridge-2.0.25.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/logging/1.1.1/logging-1.1.1.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/patchy/2.2.10/patchy-2.2.10.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/text2speech/1.13.9/text2speech-1.13.9.jar
  /Applications/MultiMC 2.app/Data/libraries/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
  /Applications/MultiMC 2.app/Data/libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar
  /Applications/MultiMC 2.app/Data/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-buffer/4.1.82.Final/netty-buffer-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-codec/4.1.82.Final/netty-codec-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-common/4.1.82.Final/netty-common-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-handler/4.1.82.Final/netty-handler-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-resolver/4.1.82.Final/netty-resolver-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-transport-classes-epoll/4.1.82.Final/netty-transport-classes-epoll-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-transport-native-unix-common/4.1.82.Final/netty-transport-native-unix-common-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/io/netty/netty-transport/4.1.82.Final/netty-transport-4.1.82.Final.jar
  /Applications/MultiMC 2.app/Data/libraries/it/unimi/dsi/fastutil/8.5.9/fastutil-8.5.9.jar
  /Applications/MultiMC 2.app/Data/libraries/net/java/dev/jna/jna-platform/5.12.1/jna-platform-5.12.1.jar
  /Applications/MultiMC 2.app/Data/libraries/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
  /Applications/MultiMC 2.app/Data/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/commons/commons-compress/1.21/commons-compress-1.21.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar
  /Applications/MultiMC 2.app/Data/libraries/org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.jar
  /Applications/MultiMC 2.app/Data/libraries/org/joml/joml/1.10.5/joml-1.10.5.jar
  /Applications/MultiMC 2.app/Data/libraries/org/slf4j/slf4j-api/2.0.1/slf4j-api-2.0.1.jar
  /Applications/MultiMC 2.app/Data/libraries/com/mojang/minecraft/1.19.3/minecraft-1.19.3-client.jar

Native libraries:
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-jemalloc/3.3.1/lwjgl-jemalloc-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-openal/3.3.1/lwjgl-openal-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-opengl/3.3.1/lwjgl-opengl-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-stb/3.3.1/lwjgl-stb-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl-tinyfd/3.3.1/lwjgl-tinyfd-3.3.1-natives-macos.jar
  /Applications/MultiMC 2.app/Data/libraries/org/lwjgl/lwjgl/3.3.1/lwjgl-3.3.1-natives-macos.jar

Params:
  --username  --version 1.19.3 --gameDir /Applications/MultiMC 2.app/Data/instances/omg rlly-/.minecraft --assetsDir /Applications/MultiMC 2.app/Data/assets --assetIndex 2 --uuid  --accessToken  --userType  --versionType release

Window size: 854 x 480

Java Arguments:
[-Dorg.lwjgl.util.DebugLoader=true, -Dorg.lwjgl.librarypath=/Applications/MultiMC 2/Data/Instances/omg rlly-/.minecraft/libraries, -Xdock:icon=icon.png, -Xdock:name="MultiMC: omg rlly?", -XstartOnFirstThread, -Xms3072m, -Xmx3072m, -Duser.language=en]

Minecraft process ID: 18552

Using onesix launcher.

[11:44:11] [main/INFO]: Building optimized datafixer
[11:44:13] [Render thread/INFO]: [STDERR]: [LWJGL] Failed to load a library. Possible solutions:
    a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
    b) Add the JAR that contains the shared library to the classpath.
[11:44:13] [Render thread/INFO]: [STDERR]: [LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[11:44:13] [Render thread/INFO]: [STDERR]: Failed to start Minecraft:
[11:44:13] [Render thread/INFO]: [STDERR]: java.lang.reflect.InvocationTargetException
[11:44:13] [Render thread/INFO]: [STDERR]:  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
[11:44:13] [Render thread/INFO]: [STDERR]:  at java.base/java.lang.reflect.Method.invoke(Method.java:578)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.multimc.EntryPoint.listen(EntryPoint.java:143)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.multimc.EntryPoint.main(EntryPoint.java:34)
[11:44:13] [Render thread/INFO]: [STDERR]: Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.mojang.blaze3d.systems.RenderSystem
[11:44:13] [Render thread/INFO]: [STDERR]:  at z.a(SourceFile:66)
[11:44:13] [Render thread/INFO]: [STDERR]:  at ejf.a(SourceFile:2408)
[11:44:13] [Render thread/INFO]: [STDERR]:  at ejf.a(SourceFile:2403)
[11:44:13] [Render thread/INFO]: [STDERR]:  at net.minecraft.client.main.Main.a(SourceFile:214)
[11:44:13] [Render thread/INFO]: [STDERR]:  at net.minecraft.client.main.Main.main(SourceFile:51)
[11:44:13] [Render thread/INFO]: [STDERR]:  at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
[11:44:13] [Render thread/INFO]: [STDERR]:  ... 5 more
[11:44:13] [Render thread/INFO]: [STDERR]: Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.dylib [in thread "Render thread"]
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.lwjgl.system.Library.loadSystem(Library.java:164)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.lwjgl.system.Library.loadSystem(Library.java:63)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.lwjgl.system.Library.<clinit>(Library.java:51)
[11:44:13] [Render thread/INFO]: [STDERR]:  at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:100)
[11:44:13] [Render thread/INFO]: [STDERR]:  at edb.<clinit>(SourceFile:8)
[11:44:13] [Render thread/INFO]: [STDERR]:  at edy.<init>(SourceFile:51)
[11:44:13] [Render thread/INFO]: [STDERR]:  at eef.<init>(SourceFile:19)
[11:44:13] [Render thread/INFO]: [STDERR]:  at eef.<init>(SourceFile:23)
[11:44:13] [Render thread/INFO]: [STDERR]:  at eef.<clinit>(SourceFile:11)
[11:44:13] [Render thread/INFO]: [STDERR]:  at com.mojang.blaze3d.systems.RenderSystem.<clinit>(SourceFile:46)
[11:44:13] [Render thread/INFO]: [STDERR]:  at net.minecraft.client.main.Main.a(SourceFile:202)
[11:44:13] [Render thread/INFO]: [STDERR]:  ... 7 more
[11:44:13] [Render thread/INFO]: [STDOUT]: Exiting with -1
Process exited with code 255 (0xff).
Please note that usually neither the exit code, nor its description are enough to diagnose issues!
Always upload the entire log and not just the exit code.
Clipboard copy at: 20 Dec 2022 11:45:28 -0600
Clipboard copy at: 20 Dec 2022 11:49:48 -0600
ws909 commented 1 year ago

I’ve had the same issue regularly pop up on MacOS, in both X86_64 and AArch64. Managed to fix it with various attempts which I can’t remember what are. Only a few days ago, I downloaded a git repository for testing some stuff, but got this error, and decided to delay looking into it, to another day.

I believe last time, all that was required, was to delete the cached folders, which I think are under var/folders.

Spasi commented 1 year ago

@meawplex-plus Hey, looks like you're using a 32-bit JVM, but LWJGL requires a 64-bit JVM on macOS. 32-bit is only supported on Windows/x86 and Linux/arm32.

meawplex-plus commented 1 year ago

@Spasi I'm actually using the Zulu 64-bit Arm64 JDK for macOS, but it's being picked up as 32-bit. I've historically used this same JDK on my Mac.

meawplex-plus commented 1 year ago

@ws909 Where under /var/folders? I don't know what directory...

ws909 commented 1 year ago

@meawplex-plus

It's a root directory. Macintosh HD/var/folders/z1/<>/T/lwjgl_<username>/. Press Shift + Cmd + . in Finder to show hidden directories.

This is merely a comment on something potentially, but unlikely, useful, so don't expect to get any wiser.

meawplex-plus commented 1 year ago

@ws909 Dang. I don't have a z1 folder under /var/folders.

ws909 commented 1 year ago

@meawplex-plus Then maybe it's somewhere inside the other folders under /var/folders, or Mojang decided to configure LWJGL into putting it somewhere else.

Spasi commented 1 year ago

Hey @meawplex-plus,

Looks like this is a known issue, see https://github.com/MultiMC/Launcher/issues/4986.

If possible, please run the application with -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true (both are required for DebugLoader to work) and post the new output here to verify that the shared library loader is working as expected.