Minecraft not running [Solved] - eviltoast

When I run the game I get this error.

I tried reinstalling both jdk and Minecraft, it didn’t change anything. I also checked the location of a java file that doesn’t exists according to error and it does exists (can’t run it anyway).

Distro is NixOS.

Fix: I installed Flatpak version of ATLauncher.