sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
6.06k stars 629 forks source link

Bug: Installing 20.2.0.r11-grl on aarch64 machine installs the x86-64 varient #807

Open erichelgeson opened 3 years ago

erichelgeson commented 3 years ago

Bug report

After installing graalvm 20.2.0.r11-grl on a Pi 4 it installs the x86-64 version instead of the aarch64 version.

To reproduce

$ sdk install java 20.2.0.r11-grl
$ java
-bash: /home/pi/.sdkman/candidates/java/current/bin/java: cannot execute binary file: Exec format error
$ file /home/pi/.sdkman/candidates/java/current/bin/java
/home/pi/.sdkman/candidates/java/current/bin/java: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, not stripped```

System info

erichelgeson commented 3 years ago

Ahh just noticed my Pi install is 32bit which is why it's failing - though it seems to be a case where it falls through for arm 32 to a state that wont work.

marc0der commented 3 years ago

Hi @erichelgeson, sounds like it could be due to a platform inference issue in our init script. Could I please ask you to post the output of uname and uname -m below?

erichelgeson commented 3 years ago
$ uname -m
armv7l

$ uname -a
Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux

$ uname
Linux
marc0der commented 3 years ago

I think I see the problem here. We will need to interpret the armv7l correctly as Linux ARM 32, although we don't support this architecture at this point.