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

Have Questions? Post them here!
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.