Oracle has released JDK 16 in March, 2021 and itโs general availability date is 2021/03/16. Every Java Professional should be curious to know what is new in Java 16. But, how will we test the new features of Java 16 practically? However, we have a good news for Eclipse users. In this article, we will learn โHow to add JDK 16 support in Eclipse 2021-03 ?โ Thanks to Eclipse community as they provide solution for developers before every new release of JDK version.
In this article, we will learn two ways of configuring JDK 16 in our eclipse. Each way will have step by step instructions to do it easily. Letโs start our topic โHow to add JDK 16 support in Eclipse 2021-03 ?โ.
Pre-requisite
โฆ JDK 16 (you can download it from here)
โฆ Eclipse 2021-03 for Enterprise Developers (You can download it from here)
How to install Java/JDK 16 ?
In order to install JDK 16, you need to download the zip file by clicking the link according to your operating system. However, you can visit the oracle site and search for the latest build of JDK 16 to get it installed. Then, you need to unzip the zip file and paste the โjdk-16โ folder in the directory where other jdk versions exist. However, in my case, it is โC:\Program Files\Javaโ which is the native place of jdk installation.
How to install Eclipse ?
Eclipse community has already suggested that we need to have a specific version of Eclipse installed in our system in order to get the support of JDK 16. The specific version is Eclipse 2021-03. You can directly click on the link to get it. Once you click on the link you will be on the Eclipse download page, then you have to click on the download link appearing on the page.
Steps to add JDK 16 support in Eclipse (eclipse jdk 16|eclipse java 16)
In order to add JDK 16 support in your eclipse, follow the below steps carefully. However, we are providing two ways to get it done. We also have included step by step images to have a clear understanding of the process.
Method-1 : Using Eclipse Marketplace
However, Eclipse 2021-03 comes with Eclipse Marketplace. If you donโt find it in any future versions, you can refer our article โHow to install marketplace in Eclipseโ. Letโs follow below steps for the first method โUsing Eclipse Marketplaceโ.
1) Make sure you already installed JDK 16 and Eclipse 2021-03 on your system. If not, kindly visit above section.
2) Open your eclipse, click on Help-> Eclipse Marketplace
3) In the search bar type โJDK 16โ or โJava 16โ and hit enter.
4) You will find one item โJava 16 Support for Eclipse 2021-03(4.19)
5) Now click on โInstallโ button
6) Next, you will see the next window with heading โConfirm Selected Featuresโ. You have to click on โConfirmโ button here. Let the checkboxes be selected as it is.
7) Now, a popup window with the message โRestart Eclipse IDE to apply the software updateโ will appear. Here, you have to click on โRestart nowโ button.
8) Then, you need to create one Test Project to check the JDK 16 support.
9) Now, click on Project -> Properties. Then select โProject Facetsโ from the left.
10) Click on โJavaโ checkbox and then select โ16โ from the dropdown and then click on โApply and Closeโ button.
ย
ย
ย
ย
ย
ย
Method-2 : Using Install New Software
Letโs follow below steps for the second method โUsing Install New Softwareโ.
1) Make sure you already installed JDK 16 and Eclipse 2021-03 on your system. If not, kindly visit a section given above for the guidelines in this article.
2) Open your eclipse, click on Help-> Install New Software
3) In the first field(Work with) paste the below URL and hit Enter.
https://download.eclipse.org/eclipse/updates/4.19-P-builds
4) Multiple values with checkboxes will appear. You have to select โEclipse Java 16 support for 2021-03 development streamโ and then click on โNextโ button.
5) At the end, restart the eclipse.
6) Then you need to create one Test Project to check the JDK 16 support.
7) Now click on Project -> Properties. Then select โProject Facetsโ from the left.
8) Click on โJavaโ checkbox and then select โ16โ from the drop-down and then click on โApply and Closeโ button.
ย
How to Verify that Eclipse has Java 16 Support
1) Click on Project -> Properties. Then select โJava Compilerโ from the left.
2) Uncheck the second checkbox (Use Compliance from execution environment)
3) Now click on the drop down there on the right side. You will see an additional entry for JDK 16 which is โ16(BETA)โ
4) Select โ16(BETA)โ and click on โApply and closeโ.
โฅ Finally, you are ready to develop a project in Eclipse using Java 16.
ย
How to test JDK 16 features in Eclipse?
1) Create a new Java Test Project in Eclipse.
2) Right click on the project and navigate to Build Path -> Configure Build Path
3) Then, click on libraries
4) Now, add libraries from the right
5) Set the installation path for JDK 16
6) Finally, enjoy the testing of JDK 16 features.
Thatโs all about configuring & testing eclipse java 16 | eclipse jdk 16 | eclipse java 16 support environment in your system.
โฅ Here is the link to get to know โHow to enable JDK 17 support in Eclipse?โ
โฅ And here is the link to get to know โHow to enable JDK 15 support in Eclipse?โ
One thought on โHow to add JDK 16 support in Eclipse 2021-03 ?โ