Open serragnoli opened 2 years ago
I think this issue should be closed as the issue seems to be an with Java on Alpine rather than asdf-java.
I believe that it is caused by Alpine using "musl libc" and instead of "glibc". apk add libc6-compat
will fix the "No such file or directory" error whenexecuting the command, but will show a different issue:
# /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/java -version
Error relocating /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/../lib/libjli.so: __strdup: symbol not found
Error relocating /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/../lib/libjli.so: __rawmemchr: symbol not found
I am using WSL2 with ubuntu and I got the same issue. I really don't know why it thinks dir doesn't exist when I run:
paulo in ~ λ java -version
/home/paulo/.asdf/lib/commands/command-exec.bash: line 28: /home/paulo/.asdf/installs/java/zulu-musl-17.38.21/bin/java: No such file or directory
Env:
OS:
Linux LAPTOP-MFFGV97N 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
SHELL:
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
ASDF VERSION:
v0.10.2-7e7a1fa
ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/home/paulo/.asdf
ASDF INSTALLED PLUGINS:
aws-amplify-cli https://github.com/LozanoMatheus/asdf-aws-amplify-cli.git main 41adc0c
awscli https://github.com/MetricMike/asdf-awscli.git main c645552
java https://github.com/halcyon/asdf-java.git master 0720a4b
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c9e5df4
I think this issue should be closed as the issue seems to be an with Java on Alpine rather than asdf-java.
I believe that it is caused by Alpine using "musl libc" and instead of "glibc".
apk add libc6-compat
will fix the "No such file or directory" error whenexecuting the command, but will show a different issue:# /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/java -version Error relocating /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/../lib/libjli.so: __strdup: symbol not found Error relocating /root/.asdf/installs/java/adoptopenjdk-17.0.0+35/bin/../lib/libjli.so: __rawmemchr: symbol not found
I'm using ubuntu 22.04 and getting this error :/
I'm using the version zulu-musl-17.42.19 and I'm getting the same error
Since the data already contains alpine/musl releases of JDKs and the script allows manipulating the grep input:
release_data=$(grep "^${ASDF_INSTALL_VERSION} " "${CACHE_DIR}/releases-${OS}-${ARCHITECTURE}.tsv" | tail -n 1)
what I did, I set the version to adoptopenjdk-17.0.9+9.*alpine.*
to just get the alpine version.
vscode ➜ /workspaces/xyz $ java --version
openjdk 17.0.9 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
on docker with alpine:3.19 with no additional packages (no libc6-compat or anything).
I wish there is a better way like using selectors ":alpine" or by adding "-musl" suffix to the version or even autodetection based on /etc/os-release for now.
I was also getting the same “No such file or directory” error with openjdk-17, but liberica-jre-musl-17.0.11+12 seems to work without error in Alpine.
I have been getting an error on getting JDK installed on Alpine Linux via
asdf
. Is it a missing dependency issue? If so, is it possible to get it/them installed?Steps followed to install the JDK