Setting up AdoptOpenJDK 11 on Eclipse IDE
Eclipse IDE: The most widely used Java IDE, now provides out of the box support for OpenJDK binaries
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
- Download AdoptOpenJDK 11 libraries for Windows 10
- Install AdoptOpenJDK on Windows 10
- Download Eclipse IDE which supports OpenJDK binaries
- Configure Eclipse IDE for AdoptOpenJDK
- Write a simple ‘Hello World’ java program
- 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
- 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.
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
Download Eclipse IDE which supports OpenJDK binaries
Go to Eclipse.org and download the version Eclipse IDE 2021–06 which supports OpenJDK 11 binaries.
Configure Eclipse IDE for AdoptOpenJDK
Follow the below steps to configure Eclipse IDE for AdoptOpenJDK
- Go to “Windows → Preferences → Java →Installed JREs”
- Click on the “Add” button and choose JRE type as “Standard VM”
- Select the location of AdoptOpenJDK home & click on Finish button
Ensure that the Java compiler compliance level is set to 11 as shown below
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