Note: Below, technician 274 (the original poster) commented:
It ended up working, after following alpinelinux wiki and installing
the IDE using flatpak.
Part of the problem is how confusing the message is.
No such file or directory is not actually referring to the java file. It's referring to the ld-linux.so interpreter specified in the elf file.
If you run the
file command on the java executable, you'll see output that looks like:
./java/bin/java: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.9, not stripped
If you look for
/lib/ld-linux.so.2, you're going to find that you don't have one, and that's the file it's complaining about.
Alpine Linux apparently uses Musl and the java binaries were compiled for glibc, which is normal for desktop Linux. On a typical desktop Linux system, that the java that ships with the Arduino IDE was compiled for, all kinds of executables make use of ld-linux.so.2. On your Alpine system, you'll find they're referring to /lib/ld-musl-i386.so.1 instead. From this vantage point, it's more of a Linux problem than an Arduino one, but I thought it might as well have something of an answer to point people toward relevant looking resources:
You may find it's easier to replace the java interpreter, but that won't be enough, because the Avrdude and GCC binaries will also expect ld-linux.so.2.
In the end, it may be easier to just not use Alpine Linux.