mojira.dev
MCL-11562

Failed to locate library: liblwjgl.so

When trying to launch Minecraft 1.14.4, it fails with an exception.

 

Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so

 

Reinstalling Minecraft.deb and running "apt install liblwjgl-java" did not seem to help this issue.

 

Attached is the full crash log.

Attachments

Comments 14

We just released a new beta version of the launcher that might fix this problem. Please try that out and let us know if this is still an issue. You can download the beta package here: https://launcher.mojang.com/download/Minecraft-beta.deb

Thank you for your help.  I have tried uninstalling the old launcher (including removing my .minecraft folder from my home directory) and installing this new launcher and it appears the result is the same.

 

I have attached the new crash log.  Please let me know if you would like me to provide any additional information.

 

[media]

Very strange. Could you please also attach launcher_log.txt from your .minecraft folder?

Sure thing!  Thank you for all your help.  This is from the beta launcher.

 

[media]

Hello, I'm having the same issue on Ubuntu 18.04 (x86_64) with Openjdk-8.

Minecraft can't find the liblwjgl files, but the jar's are there.

 

~/.minecraft $ find ./ -name *lwjgl*
./libraries/org/lwjgl
./libraries/org/lwjgl/lwjgl-opengl
./libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-opengl/3.2.2/lwjgl-opengl-3.2.2.jar
./libraries/org/lwjgl/lwjgl
./libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2.jar
./libraries/org/lwjgl/lwjgl/3.2.2/lwjgl-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-jemalloc
./libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2.jar
./libraries/org/lwjgl/lwjgl-jemalloc/3.2.2/lwjgl-jemalloc-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-openal
./libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-openal/3.2.2/lwjgl-openal-3.2.2.jar
./libraries/org/lwjgl/lwjgl-stb
./libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2.jar
./libraries/org/lwjgl/lwjgl-stb/3.2.2/lwjgl-stb-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-glfw
./libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2-natives-linux.jar
./libraries/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar

I'm attaching the launcher_log.txt and the crash report.

 

[media][media]

 

UPDATE:

I tried fresh installations of Ubuntu 18.04 and 19.04. On both the game works as expected, so I suppose my current installation is broken and it's not a game bug.

 

I also tried Debian 10 and it doesn't have java-8 but java-11. Minecraft asks for java-8 so I suspect that's why it doesn't work on debian 10.

4 more comments

Minecraft 1.14.4:

Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl.so

Minecraft 1.12.2:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/foo/d1dc-158e-254c-718f/liblwjgl64.so: /tmp/foo/d1dc-158e-254c-718f/liblwjgl64.so: failed to map segment from shared object

Minecraft 1.0:

[Info: GameCallbacks.cpp(138)] Game/game () Info Exception in thread "Minecraft main thread" java.lang.UnsatisfiedLinkError: /tmp/foo/9fbe-9ff8-c48e-f38c/liblwjgl.so: /tmp/foo/9fbe-9ff8-c48e-f38c/liblwjgl.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

The cause of all of these errors (and probably others still, for other versions), in probably most people having them semi-recently (although other similar reports apparently mention 32-bit or older MacOS systems... but maybe this wasn't even the problem for them...? if they were older problems, with the previous launchers, maybe their /home directory was actually noexec too...?), is simply /tmp being mounted as noexec...

The previous launchers apparently extracted these files to ~/.minecraft (and the home directory is seldom mounted as noexec, contrarily to /tmp...).

You can thus simply start minecraft-launcher with a TMPDIR set to a directory on an exec partition.

For example:

mkdir "$HOME/.tmp"
TMPDIR="$HOME/.tmp" minecraft-launcher

(... well, depending on where you put minecraft-launcher, of course).

I suppose the launcher should check for a noexec on the partition hosting TMPDIR, and at least warn the user explicitly, considering how the error messages in this case are misleading and changing, depending on the Minecraft version...

The launcher could also use the XDG cache directory, instead of TMPDIR, for its temporary files, at least when it's mounted noexec... The /home directory is seldom on a noexec partition...

https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

The comment above by @unknown turned out to be my issue. Am now able to use the latest launcher (as downloaded from the official website) and run 1.14.4 with no further issues on Gentoo. This error definitely needs better handling.

I remove "noexec" from mountpoint /tmp, problem was solved.
Of course, it was solved by setting "TMPDIR" to the directory where "noexec" is not set.
Kugemere Ipumebyu's analysis is correct.
As Mike Kloko wrote, The minecraft-launcher needs to be modified.

Why doesn't the minecraft launcher just store these system libraries in e.g. ~/.minecraft/system-libraries? /tmp and $XDG_CACHE_HOME seem completely arbitrary to me. Disk quotas and permission exist for a reason, and I doubt the launcher really has to re-download and unpack these libraries every time the game is launched anyway.

A bug fix containing a change as to where temp storage is located will be released within a reasonable timeframe. This should avoid the scenarios described above. Well, as long as that containing folder allows files to be run.

Ben Cooper

migrated

Unconfirmed

crash

Retrieved