본문 바로가기
1. SW 개발 & IT 트렌드

How to Install Java on Raspberry Pi

by soosun 2020. 6. 12.

There are two different implementations of Java, Oracle Java and OpenJDK.
- OpenJDK is an open-source implementation of the Java Platform.
- Oracle Java has a few additional commercial features and a 
license that permits only non-commercial use, such as personal or development use.

This guide explains how to install Java (OpenJDK) on Raspberry Pi with the latest Raspbian OS running on it.
https://openjdk.java.net/

The standard Raspbian repositories include two different Java packages, Java Runtime Environment (JRE) and Java Development Kit (JDK). JRE includes the Java virtual machine (JVM), classes, and binaries that allow you to run Java programs. JDK consist of JRE and development/debugging tools and libraries necessary to build Java applications.

If you are not sure which Java package to install, the general recommendation is to stick to the default OpenJDK (JDK 11) version. Some Java-based applications may require a specific version of Java, so you should consult the application documentation.

Installing Java to the Raspberry Pi

1.Before we go ahead and install Java we need first to ensure that everything is up to date.
$ sudo apt update
$ sudo apt upgrade

2. Once the update process has completed, we can proceed to install the latest available version of Java to our Raspberry Pi.
We are using the package default-jdk as this will always point to the latest available version of the JDK for Raspbian.
$ sudo apt install default-jdk

3. To test Java, all we need to do is run the following command on the Raspberry Pi.
$ java -version

4. Out put
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.5+10-post-Raspbian-1deb10u1, mixed mode)

https://linuxize.com/post/install-java-on-raspberry-pi/

댓글