0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Unstable] How to install openjdk-8-jdk on Raspbian Buster armhf

Last updated at Posted at 2019-08-14

Bazel_bin GitHub stars

1.Introduction

[October 20, 2019] This procedure is deprecated at this time. Click here for the stable procedure. [Stable] Install openjdk-8-jdk safely in Raspbian Buster (Debian 10) environment

In Raspbian Buster, openjdk-8-jdk is excluded from the supported packages. The procedure for installing openjdk-8-jdk is described below. The same procedure works for other architectures such as aarch64 and x86_64 and other.

Click here for the procedure by Debian Buster.

2.Procedure

Edit_sources.list
$ sudo nano /etc/apt/sources.list

Add the following deb http://... to the bottom line.

Add_the_following_line
deb http://deb.debian.org/debian/ sid main

Quit Nano editor.
Ctrl+O
Ctrl+X

Install_openjdk-8-jdk
$ sudo apt-get install -y debian-keyring debian-archive-keyring
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
$ sudo apt-get update
$ sudo apt-get install -y openjdk-8-jdk
Java_version_switch
$ sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
Javac_version_switch
$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                          Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/javac   1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/javac   1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-armhf/bin/javac    1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
Java_version_check
$ java -version

openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1-b10)
OpenJDK Client VM (build 25.222-b10, mixed mode)

$ javac -version
javac 1.8.0_222
Edit_sources.list
$ sudo nano /etc/apt/sources.list

Delete the following deb http://... from the bottom line.

Delete_the_following_line
deb http://deb.debian.org/debian/ sid main

Quit Nano editor.
Ctrl+O
Ctrl+X

$ sudo apt-get update

3.Reference articles

https://novicestuffs.wordpress.com/2017/04/25/how-to-uninstall-java-from-linux/
https://stackoverflow.com/questions/57031649/how-to-install-openjdk-8-jdk-on-debian-10-buster
apt-get updateで、There is no public key available と出た時の対処。 - d6rkaiz - Qiita

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?