Java OpenJDK 11 can make use of the apk (Alpine package installer),
# apk add openjdk11
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/aarch64/APKINDEX.tar.gz
(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 (11.0.16.1_p1-r0)
...
(25/30) Installing openjdk11-jre (11.0.16.1_p1-r0)
(26/30) Installing openjdk11-jmods (11.0.16.1_p1-r0)
(27/30) Installing openjdk11-jdk (11.0.16.1_p1-r0)
(28/30) Installing openjdk11-demos (11.0.16.1_p1-r0)
(29/30) Installing openjdk11-doc (11.0.16.1_p1-r0)
(30/30) Installing openjdk11 (11.0.16.1_p1-r0)
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.
Above is an example, where I installed OpenJDK 11 on Alpine Linux Image running on an M2 Mac
Facing issues? Have Questions? Post them here! I am happy to answer!
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: rakesh@code2care.org
More Posts related to Java,
- Get the current timestamp in Java
- Java Stream with Multiple Filters Example
- Java SE JDBC with Prepared Statement Parameterized Select Example
- Fix: UnsupportedClassVersionError: Unsupported major.minor version 63.0
- [Fix] Java Exception with Lambda - Cannot invoke because object is null
- 7 deadly java.lang.OutOfMemoryError in Java Programming
- How to Calculate the SHA Hash Value of a File in Java
- Java JDBC Connection with Database using SSL (https) URL
- How to Add/Subtract Days to the Current Date in Java
- Create Nested Directories using Java Code
- Spring Boot: JDBCTemplate BatchUpdate Update Query Example
- What is CA FE BA BE 00 00 00 3D in Java Class Bytecode
- Save Java Object as JSON file using Jackson Library
- Adding Custom ASCII Text Banner in Spring Boot Application
- [Fix] Java: Type argument cannot be of primitive type generics
- List of New Features in Java 11 (JEPs)
- Java: How to Add two Maps with example
- Java JDBC Transition Management using PreparedStatement Examples
- Understanding and Handling NullPointerException in Java: Tips and Tricks for Effective Debugging
- Steps of working with Stored Procedures using JDBCTemplate Spring Boot
- Java 8 java.util.Function and BiFunction Examples
- The Motivation Behind Generics in Java Programming
- Get Current Local Date and Time using Java 8 DateTime API
- Java: Convert Char to ASCII
- Deep Dive: Why avoid java.util.Date and Calendar Classes
More Posts:
- [fix] Java JDBC SQLSyntaxErrorException: Unknown database - Java
- How to fix: zsh: command not found: jupyter - zsh
- 10 FTP SFTP Clients and Alternatives - FTP
- Run Gradle Build without test cases - Gradle
- How to Merge Branch into Master Branch - Git
- Java JDK 21: JEP 439 - An Improved Generational Z Garbage Collector (ZGC) - Java-JDK-21
- How to Change Java JDK Version in IntelliJ IDE - Java
- 44: Take a string and print it in lower case. [1000+ Python Programs] - Python-Programs