I'm not able to install Java 21 on Raspberry Pi 5. I download ARM versions from openJDK and Oracle, but both don't work for me.
When typing ./java it prints: "No such file or directory" (I'm sure I'm in the right directory)
I cannot find any repository I can use to install Java 21 and I need newer version of Java than 17 for my projects written in Java 21.
file ./java output
./java: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not stripped
ldd ./java output:
java is "not a dynamic executable"
Do you have any idea how I can install Java 21 on Raspberry Pi 5?
How to reproduce:
OpenJDK: From website (https://jdk.java.net/21/) I downloaded version for Linux / AArch64, unpacked it and try to run java executable from unpacked directory bin/java using java command inside of the mentioned directory
Oracle JDK: I download from website (https://www.oracle.com/pl/java/technologies/downloads/) version for ARM64 Compressed Archive and did exactly as with OpenJDK version.
Distribution is the default for Raspberry Pi 5: Raspberry Pi OS 64 bit (based on Debian)
Output for find / -name java -type f -exec ls -l {} ; 2>/dev/null:
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ find / -name java -type f -exec ls -l {} ; 2>/dev/null -rwxr-xr-x 1 bloodlex bloodlex 70792 10-05 15:44 /home/bloodlex/Download/jdk-21.0.1/bin/java
Output for file /bin/ls:
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ file /bin/ls /bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=73a3ba02d9f4bf3632cbebe139c6a844ca5076d3, for GNU/Linux 3.2.0, stripped
Output for uname -a
bloodlex@raspberrypi:~/Download/jdk-21.0.1/bin $ uname -a Linux raspberrypi 6.1.0-rpi6-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.58-1+rpt2 (2023-10-27) aarch64 GNU/Linux
find / -name java -type f -exec ls -l {} \; 2>/dev/null