AdoptOpenJDK Docker Image for Linux, MacOS and Windows

AdoptOpenJDK Docker image

image courtesy - https://hub.docker.com/_/openjdk

Quick guide to download and install AdoptOpenJDK docker image.


What is AdoptOpenJDK


AdoptOpenJDK started out as a fork of OpenJDK. It was initially known as “OpenJDK Community Technology Preview (CTP) 8.0.” Then, in 2016, it became its own independent project. From 24th July 2021, AdoptOpenJDK is moving to the Eclipse Foundation and rebranding. You can find all builds in the new Adoptium site Adoptium OpenJDK . Please refer openjdk vs adoptopenjdk to know the differences.


If you want to know more about OpenJDK, you can go through Open Java Development Kit Quick guide.


Note: To uninstall previously installed OpenJDK please refer Uninstall OpenJDK Windows



NOTE # : AdoptOpenJDK Alternatives


There are many OpenJDK vendors out there in the market ( here is the OpenJDK Vendors List ), you can download OpenJDK from AdoptOpenJDK, Redhat OpenJDK, Zulu OpenJDK or from Community OpenJDK.

Below are the steps to download and install Community OpenJDK. If you would like to install OpenJDK from other vendors please refer :


AdoptOpenJDK Docker Image



We can use the adoptopenjdk docker image as both the build and runtime environment. We can compile and run our project simply by adding below lines in the Docker file.



Configure Docker file.

			
FROM adoptopenjdk/openjdk11:ubi
RUN mkdir /opt/app
COPY japp.jar /opt/app
CMD ["java", "-jar", "/opt/app/japp.jar"]

			

Run and build the Docker image:


$ docker build -t japp .
$ docker run -it --rm japp

To get a specific version of a docker image, add the build number as shown in the following example:

$ docker run --rm -it adoptopenjdk/openjdk11:jdk-11.0.9.1_1 java -version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.9.1+1, mixed mode)

Congratulations !!! Now you have configured AdoptpenJDK Docker image Successfully. For more info, please refer AdoptOpenJDK Docker Image

Download OpenJDK - here are the OpenJDK versions you might be interested in!


OpenJDK 7 Download Windows 64 bit
OpenJDK 8 Download Windows 64 bit
OpenJDK 9 Download Windows 64 bit
OpenJDK 10 Download Windows 64 bit
OpenJDK 11 Download Windows 64 bit
OpenJDK 12 Download Windows 64 bit

If you are looking out for earlier OpenJDK versions, go to OpenJDK Archive











Read Next :



x
Subscribe to Our Newsletter

Get the latest updates and exclusive content delivered to your inbox!