Thank you for the suggestions. I double checked the folder permissions as suggested but they looked fine. However, I found out it must be related to the java executable. I’ve recently updated asdf to the latest version which had a lot of breaking changes and I had some problems with configuring my $PATH
correctly. It’s likely related to that.
# This code:
System.cmd("java", ["--version"]) |> IO.inspect()
System.cmd("java", ["--version"], env: [{"HOME", tmp_path}]) |> IO.inspect()
# Returns this:
{"openjdk 21.0.2 2024-01-16 LTS\nOpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)\nOpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode)\n",
0}
{"", 126} <- See how the second call returned the permission error
Edit: Yeah, it seems to be an asdf
issue (issue). I’ve created a bug report here: bug: overwriting $HOME in shim command returns 126 permission error · Issue #1999 · asdf-vm/asdf · GitHub