Sudo mv adoptopenjdk-archive-keyring.gpg /usr/share/keyrings & sudo chown root:root /usr/share/keyrings/adoptopenjdk-archive-keyring.gpgĮcho "deb bullseye main" | sudo tee /etc/apt//adoptopenjdk.list adoptopenjdk-keyring.gpg -export -output adoptopenjdk-archive-keyring.gpgĪfter reading the documentation, it perhaps creates a keyring from the gpg file. adoptopenjdk-keyring.gpg -import public gpg -no-default-keyring -keyring. Make the key accessible by apt gpg -no-default-keyring -keyring. We do this because we want to trust AdoptOpenJDK when using apt. Here lies a regular PGP key that starts with the familiar This downloads the file to our current directory. gnupg: Package for an implementation of OpenPGP for cryptography.apt-transport-https: Package that allows us to get from HTTPS endpoints.Sudo apt-get install -y wget apt-transport-https gnupg The following instructions are more annotated versions of the install guide. We could download and install the binaries ourselves, but I like the extra that apt gives us such as a common place for the repository binaries and being able to install/uninstall easily. Installation Commandsįor this exercise we'll be setting up apt with the AdoptOpenJDK package repository such that we can just use a sudo apt-get install call for our Java package. There's an installation guide for many operating systems and I picked one for 64bit Linux as it also had instructions specifically for the Raspberry Pi OS at the bottom. The latest offered by AdoptOpenJDK is Java 16. After reading about it for a bit, getting confused around licencing and JRE binaries for different *nix distributions I found AdoptOpenJDK (soon to be Adoptium). I remembered that Oracle bought Java ages ago and there was a huge licencing issue in the community afterward. Searching for a later Java version lead me to the split road that is OpenJDK and Oracle. Just for fun I decided to try to install the source: Unable to install Java 17. I'm not particularly good with any Unix based OS and seeing openjdk-17-doc and openjdk-17-source in the above screenshot didn't fill me with "Oh that's the JRE, I'll just install that". We can check this by running apt-cache search jdk Openjdk search results. As of writing this (2022), Java 16 isn't readily available via apt-get on a Pi Zero 2 W.
0 Comments
Leave a Reply. |