How to install Java OpenJDK 11 on Alpine Linux

Java OpenJDK 11 can make use of the apk (Alpine package installer),

# apk add openjdk11
(1/30) Installing java-common (0.5-r0)
(2/30) Installing libffi (3.4.2-r1)
(3/30) Installing p11-kit (0.24.1-r0)
(4/30) Installing libtasn1 (4.18.0-r0)
(5/30) Installing p11-kit-trust (0.24.1-r0)
(6/30) Installing ca-certificates (20220614-r0)
(7/30) Installing java-cacerts (1.0-r1)
(8/30) Installing openjdk11-jre-headless (
(25/30) Installing openjdk11-jre (
(26/30) Installing openjdk11-jmods (
(27/30) Installing openjdk11-jdk (
(28/30) Installing openjdk11-demos (
(29/30) Installing openjdk11-doc (
(30/30) Installing openjdk11 (
Executing busybox-1.35.0-r17.trigger
Executing java-common-0.5-r0.trigger
Executing ca-certificates-20220614-r0.trigger
OK: 258 MiB in 44 packages

Based on your Alpine Linux version, you will get an ARM-based (supported by M1/M2 Silicon) or Intel-based JDK version.

Installing OpenJDK 11 on Alpine Linux

Above is an example, where I installed OpenJDK 11 on Alpine Linux Image running on an M2 Mac

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap