Reputation: 374
I was trying to set up a MineOS server on a Raspberry Pi when I ran into an issue where I couldn't update the java version to Java 16. The Raspberry Pi is running the ARM64 architecture and I got my JDK from https://adoptopenjdk.net/releases.html?variant=openjdk16&jvmVariant=hotspot. Here is the specific JDK I downloaded onto my Raspberry Pi: https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz. To install it and add it to my $PATH, I did:
tar -xf OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz -C /opt/
ln -s /opt/jdk-16.0.1+9/bin/java /usr/bin/java
When running java --version
, I get /usr/bin/java: No file or directory
. Does anyone know why this is? Before I figured out that Raspberry Pi supports ARM64, I did this on ARM32 and it worked fine, but I needed to be able to allocate more memory to a server, so I had to update to ARM64. If you need more information, I can provide it if necessary.
Upvotes: 0
Views: 793
Reputation: 191973
I did this on ARM32 and it worked fine, but I needed to be able to allocate more memory to a server, so I had to update to ARM64
I assume you mean you are using different Pi now?
On a Pi3, I can do
wget https://github.com/AdoptOpenJDK/openjdk16-binaries/releases/download/jdk-16.0.1%2B9/OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz
sudo tar -xzvf -C /opt OpenJDK16U-jdk_aarch64_linux_hotspot_16.0.1_9.tar.gz
/opt/jdk-16.0.1+9/bin/java --version
Note: tar -xz
is for TAR.GZ files, and you only wrote -x
in the question...
And that gives me an error about the non-compatible binary, as expected since my Pi needs ARMv7.
From there, I would update the PATH without a symlink, like how is done in Install Java 16 on Raspberry Pi 4
So, that being said, if the file does indeed exist, then there is some other permissions issue you're having
I want the jdk to be stored in /opt/ and easy to remove all of the files related to it.
I see no real need for /opt
. If you can use apt
/pkg
to install, then you can also use it to remove/purge files for it
Upvotes: 1