Setting up AdoptOpenJDK 11 on Eclipse IDE

Anupindi RaviShankar
3 min readJun 24, 2021

Eclipse IDE: The most widely used Java IDE, now provides out of the box support for OpenJDK binaries

Photo by Riku Lu on Unsplash

In this article, we will learn how to set up Eclipse IDE for AdoptOpenJDK, one of the JDK binaries based on the OpenJDK codebase. We will also write a simple “Hello World” program to confirm the setup.

Following are the steps involved

  1. Download AdoptOpenJDK 11 libraries for Windows 10
  2. Install AdoptOpenJDK on Windows 10
  3. Download Eclipse IDE which supports OpenJDK binaries
  4. Configure Eclipse IDE for AdoptOpenJDK
  5. Write a simple ‘Hello World’ java program
  6. Enhance the program to show JDK modular feature

Download AdoptOpenJDK 11 libraries for Windows 10

Please following below steps to download the AdoptOpenJDK 11 library

  1. Go to https://adoptopenjdk.net/ and select the option Download for Windows x64. The latest stable release as of this writing is jdk-11.0.11+9. Please keep the default options for Version and JVM options. For Version, it is OpenJDK 11 (LTS) & for JVM it is HopSpot.
AdoptOpenJDK Download Screen shot

Install AdoptOpenJDK on Windows 10

You will find msi file downloaded. In my case it was OpenJDK11U-jdk_x64_windows_hotspot_11.0.11_9.msi. You have to simply follow the steps and install the AdoptOpenJDK on your machine. Ensure that JAVA_HOME and PATH are properly updated in the System Environment variables as shown below

System Environment Variable settings

Download Eclipse IDE which supports OpenJDK binaries

Go to Eclipse.org and download the version Eclipse IDE 2021–06 which supports OpenJDK 11 binaries.

Eclipse IDE version 2021–06

Configure Eclipse IDE for AdoptOpenJDK

Follow the below steps to configure Eclipse IDE for AdoptOpenJDK

  1. Go to “Windows → Preferences → Java →Installed JREs
  2. Click on the “Add” button and choose JRE type as “Standard VM
  3. Select the location of AdoptOpenJDK home & click on Finish button
Image showing jdk11 as the installed JRE

Ensure that the Java compiler compliance level is set to 11 as shown below

Image showing the compiler compliance level set to 11

Write a simple ‘Hello World’ java program

Enhance the program to show case JDK modular feature

Now we will enhance the same program to showcase the JDK modular feature.

Conclusion

In this article, we have seen how to set up AdoptOpenJDK 11 with Eclipse IDE and confirmed it's working with a simple HelloWorld program. The same program is also enhanced to showcase the working of the Java Platform Module feature which is supported from JDK 9 onwards.

Hope you find this article useful !!! Please do let me know your review comments and suggestions.

HAPPY READING

--

--