# Installing the Latest Versions of Java on the Raspberry Pi

## Метаданные

- **Канал:** Pi My Life Up
- **YouTube:** https://www.youtube.com/watch?v=0JM0N7wgmfs
- **Источник:** https://ekstraktznaniy.ru/video/39343

## Транскрипт

### Segment 1 (00:00 - 05:00) []

Hi everyone, it's Emmet from Pi My Life up. In this quick video, we will be showing you how to install the latest version of Java on a raspberry Pi. Java is a popular programing language that requires a runtime environment for it to operate. Raspberry Pi OS actually typically includes a version of the Java Runtime environment, but it's usually significantly out of date. For example, with Raspberry Pi OS bookworm, you can only install Java 17 by default, even though the latest version is Java 24. While this might be fine for a few cases, some software such as the Minecraft server requires the newer versions of Java. Luckily, we can work around this by adding a third party repository that builds these newer versions of Java for ARM systems like ours. There is one catch to using this repository, and that is you must be running a 64 bit operating system. For this particular guide, we will be running Raspberry Pi OS bookworm 64 bit edition. They should work for any other 64 bit Debian based operating system that can run on a Raspberry Pi. Once you are ready to proceed, open up the terminal on your Raspberry Pi. Now, before we begin to install the Java Runtime environment to our Pi, we want to update the package list cache by typing sudo apt update and pressing enter. Once the package list has finished updating, upgrade any out-of-date packages by typing sudo apt upgrade hyphen y and then pressing enter. We now need to install the software that we need to set up the Azul Java repository on our Raspberry Pi. We can install these by typing sudo apt install curl gnupg CA hyphen certificates, and then hyphen y and then press enter. These packages are typically pre-installed with Raspberry Pi OS, but we should just make sure so we don't run into issues later. Our next step is to add the Azul repository to our Raspberry Pi. Azul is a company that has a focus on Java development, and also happens to provide a repository that provides newer versions of Java. Before we can add the repository itself, we will need to install the GPG key to Raspberry Pi. This key is essentially used to verify the packages we are downloading did in fact come from this repository. Add this key to your system by typing curl hyphen s https colon. Forward slash repos dot azul dot cot slash azul hyphen repo dot key space pipe symbol space sudo space GPG space hyphen dearmor space hyphen o space slash usr slash share slash keyrings slash azul dot gpg and then press enter. With the key now saved to our system, we can add the repository itself to our sources by typing echo space. Double quote Deb space open square bracket arch equals arm64 space signed hyphen by equals sign slash usr share slash keyrings slashes azul dot gpg close square bracket space https colon. Forward slash repos dot azul dot com slash zulu slash deb Space stable space main double quote space pipe symbol space sudo space tee space slash etc slash apt slash. sources dot list dot d slash zulu dot list and then press enter. As we have made changes to the available sources, we will need to run an update again by typing sudo apt update and pressing enter. Once the update complete, you'll now be able to install new versions of Java onto your Raspberry Pi if you want to check what versions are available from the Azul repository, type in sudo apt search Zulu and then the asterisk symbol and then press enter. This will show you a giant list, but scroll up a little and you'll be able to see the different versions of Java that you are now able to install. You should also have access to the latest versions of Java as well as some older version such as Java eight. For this example, we'll be using this repository

### Segment 2 (05:00 - 05:00) [5:00]

to install Java 21 onto our Raspberry Pi. This is the same version of Java that is required by the Minecraft server to run. To install this version of Java, type in sudo apt install Zulu 21. Hyphen jdk hyphen headless hyphen y and then press enter. You can verify that you have now installed a new version of Java onto your Raspberry Pi by typing Java hyphen version, and then pressing enter. With the response from this command, we can see that we successfully installed Java 21 on to our Raspberry Pi. If you found this guide to be helpful, be sure to give us a thumbs up and subscribe for more content. Until next time, have a good one!
