ATLauncher: executables 'not found'

Hello, im using nixos for a while now and wanted to use my custom minecraft launcher ‘atlauncher’. anyways, at trying to launch minecraft, it says that the executable ~/.local/share/ATLauncher/runtimes/minecraft/java-runtime-delta/linux/java-runtime-delta/bin/java is not found. i navigated to that directory and have seen: the file is there and looked ok. then i tried to execute it, and my shell sayed the file is not found. what is going on there?

i already tried:

  • tried to execute as root - same result
  • copied executables from debian (there it works) - nothing works anymore - launcher doesnt starts anyway
  • used manually downloaded JAR - same results.
  • replaced executable java with default java 17 executable: cp -rL /run/current-system/sw/bin/java ~/.local/share/ATLauncher/runtimes/minecraft/java-runtime-delta/linux/java-runtime-delta/bin

nothing of that worked in any way. can anyone help me with that? would be very happy.

Those runtimes probably won’t work on NixOS. You should try using the jre from the nix store that comes pre-installed with the program, instead.

You can set it by going to the Settings > Java/Minecraft > Java Path menu.

You might also want to untick the Use Java Provided By Minecraft? box as well.

As different Minecraft versions might need different java versions, you might want to override the jre you have:

environment.systemPackages = with pkgs; [
  (pkgs.atlauncher.override {
    jre = temurin-jre-bin-8;

Here is a version compatibility list from the Minecraft Wiki entry:

Minecraft Version Minimum Compatible JRE Version
< 1.17 8
1.17 16
>= 1.18 17
1 Like

well, that actually solved that it doesnt launch anyway, but now i get this message:

what is this? i would guess it means i need a newer java version, but idk how to configure that (i already have installed jdk21)

In NixOS 23.11, jre is at version 19, so you need to override the version that atlauncher uses to 21:

environment.systemPackages = with pkgs; [
  (pkgs.atlauncher.override {
    jre = temurin-jre-bin-21;

should i just write it into configuration.nix?

Yes, just replace it with your existing atlauncher in the configs.

environment.systemPackages = with pkgs; [
-  atlauncher  
+  (atlauncher.override {
+    jre = temurin-jre-bin-21;
+  })

Edit: If you want to know what this is doing, it’s effectively overriding the jre defined in the atlauncher derivation, which by default uses the jre from the system (version 19 for NixOS 23.11).

well, now it gives me the following error message:

java.lang.UnsatisfiedLinkError: /home/noof/.discord-rpc/ cannot open shared object file: No such file or directory
	at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
	at java.base/jdk.internal.loader.NativeLibraries$ Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)
	at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
	at java.base/java.lang.Runtime.load0(Unknown Source)
	at java.base/java.lang.System.load(Unknown Source)
	at com.atlauncher.App.ensureDiscordIsInitialized(
	at java.base/ Source)

then it waits for ~15 sec, and then the launcher appears back again.

This might be an issue related to Discord integration and ATlauncher. Try unticking the Settings > General > Enable Discord Integration? for now and see if it works.

well, that fixed the error messages, but minecraft still dont appears. and the launcher starts again after ~5 sec.

I also can’t get atlauncher to work. I think that it’s probably best for you to use prismlauncher instead.

okay, just also tried with default minecraft launcher. same result, error message:

I want to roll back for a minute and explain the first part; please feel free to ignore this paragraph if you do not care. For what its worth, the not found error is correct, just misleading. A file is not found. What’s happening is that something (your shell) is eventually calling the Linux ‘exec’ syscall, which runs the ELF binfmt module (the module which loads ELF files, the type of executable generally used on Linux.) Most ELF binaries are dynamically linked, which just means they link to shared objects. The OS kernel doesn’t typically handle actually loading these modules. Instead, the ELF file specifies another file on disk; the kernel loads this file, the dynamic linker, which then performs the actual work. The problem is that this file is typically at a specific location, like /lib64/, which isn’t present on NixOS: all NixOS libraries go into the Nix store so that the version of a library never changes by surprise. So the kernel returns a typical file not found error. Unfortunately, syscall errors don’t distinguish between the file you tried to execute not being found and the linker it needs not being found.

OK. As eljamm has pointed out, the most correct thing to do from a NixOS standpoint is try to use Nix as intended, which can be done a couple of ways. You can use NixOS-compiled binaries like the JRE, which will provide the best integration into NixOS.

However I worry that a lot of stuff may expect to be able to use shared objects that link to system libraries. In this case, you may need something more advanced, like Nix-LD or an FHS environment. The Nix-LD approach is useful if you really just want to be able to use the normal software as it would run elsewhere; I recommend giving it a shot if you aren’t able to get this working.

If you are interested in trying the Nix-LD approach, I can’t find a great third party resource, but please feel free to check the compat.nix module in my own NixOS configuration. It may have more or less libraries than you need, but it should make it possible to use the raw binaries that work on other Linux systems.

Sorry if this isn’t useful. I generally think using Nix-based solutions is overall the best way to go, but I think it’s immensely useful to have a system Nix-LD configuration, and I use it all the time for running random binaries.

The FHS approach is even more likely to work, as it emulates even more of the standard Linux system, but it’s a bit harder to set up.

1 Like

According to the Wiki:

Offical Minecraft Launcher: WebsitePackage/>pkgs.minecraft

Warning: 1.19 or higher is not working on NixOS, using alternative clients is strongly recommended.

oh well, havent seen yet. so that won’t work…

Thanks for the amazing explanation @jchw. nix-ld is great if you just want to use your system without headaches and I’ve thought about using it before. I guess my only reservation with it would be not being able to tell if a binary would fail normally.

If I had it installed, does unsetting NIX_LD and NIX_LD_LIBRARY_PATH turn nix-ld off?
If that’s the case, would I be able to turn it on by sourcing them when I need to?

Correct, unsetting NIX_LD or NIX_LD_LIBRARY_PATH will render Nix-LD ineffective.

If you want, you can use Nix-LD with nothing in the global NIX_LD_LIBRARY_PATH and use a flake or similar to set up specific environments instead. This sort of setup is documented at the official Nix-LD page.

Unfortunately, there’s no way to do this for the /bin/bash shim I also have in my setup, but it’d probably be a good idea to come up with an escape hatch for that, too. It’s often also needed to run random stuff.

1 Like

Thanks, this is pretty useful. I’ll give it a try sometime soon.

I have been reading through this thread, but I’m still confused about one thing, is ATLauncher not working as expected because the Discord integration is failing? If so, @eljamm is this happening on your system due to the same issue? I haven’t noticed this on my system.

No, I don’t think it’s because of discord integration, as adding discord-rpc or disabling the option in the launcher fixes that. For me, it’s crashing with:

GLFW error 65542: GLX: Failed to load GLX.


Edit: I’ve set up nix-ld in a shell with theese packages:

But it still crashes for me.

Maybe worth trying to run it with LD_DEBUG=libs, perhaps we can find out why GLX isn’t able to be loaded.