Install Java Development Kit 17 (JDK), which provides the language and a compiler. The runtime environment (JRE) lets you execute Java. The JDK lets you compile Java sources into executable classes. There are two main distributions: Oracle JDK and OpenJDK.
We chose the second one under the GNU General Public License because the Oracle JDK license changed for releases starting in April 2019, permitting only certain uses at no cost. However, you can download the commercial builds of JDK from Oracle(https://www.oracle.com/java/technologies/downloads/#java17) under a non-open-source license at the Oracle Technology Network.
Here are the steps that need to be followed to install Java SE:
- Select the Java with your operating system. (Download the OpenJDK release for your platform from https://jdk.java.net/17/)
- Click on the link to the installer that fits your operating system and the format (extension) you are familiar with.
- If in doubt, click the Installation Instructions link below and read the installation instructions for your operating system.
- Follow the steps that correspond to your operating system.
- The JDK is installed successfully when the java -version command on your computer displays the correct Java version, as demonstrated in the following example
OpenJDK and Oracle JDK binaries are compatible and close to each other, but there are some differences.
- Oracle JDK source code includes the following text: “ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.” The OpenJDK refers to the GPL license terms.
- The output of Java the version in Oracle JDK includes the Oracle-specific identifier. OpenJDK does not include the Oracle-specific identifier.
- Oracle JDK uses the Java Cryptography Extension (JCE) Code Signing Certificate. OpenJDK allows unsigned third-party crypto providers.
- OpenJDK is offered only as a compressed archive. Oracle JDK offers installers.
Add the JDK path to the PATH environment variable
export PATH=/usr/local/jdk-17/ /bin
java -version
Visit our Website ProcareerGrowth for Genuine Content.