How to Download and Install Java Runtime Environment and JDK on Mac
In this article, we will discuss how to download and install the latest version of Java Runtime Environment and JDK on Mac OS, which is JDK15. We will look into the new features introduced in this version. Also will look at the system requirements for installing the JDK15 and the JRE comes with it.
1. Latest version
The latest and the most recent version of java is Java15, which was released and was in general availability from 15th September 2020.
1.1 Features of Java15
There are several features introduced, and some of them are shown below.
1) Hidden Classes: This feature allows us to create hidden classes that are not discoverable and are generated dynamically at runtime. Hidden classes will have a very short lifecycle.
2) Sealed Classes: The sealed classes are introduced to provide more fine-grained control for Java’s inheritance. Sealed classes provide restriction over the subclasses, meaning what the classes that can extend a parent-sealed class are. It used the keyword sealed and permits for defining the sealed classes.
3) Pattern matching: This the preview feature that allows us to check the type of the class using the instanceof operator by casting and binding it in a single line, unlike before, where we need to check the type first and then go for casting the type
4) Text blocks: Text blocks are being made a permanent feature in Java15 where we can write multi-line strings without escaping.
5) Record enhancement: Java15 has enhanced the preview feature of the records that were introduced in Java14. It has added sealed types, annotations for records, local records, and reflection APIs for records.
Other than this there are several changes and enhancements done in the garbage collector, foreign memory access API, removal of the nashorn javascript engine, etc.
2. System Requirements
Any macOS running on the intel based computer and administrator privileges are required to install JDK15 and JRE in macOS which is installed in whole system and not for a single user.
3. Installing JDK on macOS
Follow the steps below to install JDK 15 on macOS
3.1 Downloading the JDK
Go to the website here . Select the macOS installer for JDK15 as shown below
Upon clicking the JDK above, it will show the popup for the End User License Agreement. Accept the agreement by clicking the checkbox. Once checked, the download button will be enabled, as shown below.
3.2 Installing JDK15 and Java Runtime Environment on Mac
Double click the JDK15 installer that was downloaded. Follow the instructions by clicking continue.
It will prompt for the administrator username and password, enter and continue. The java will be installed, you can verify the installation as shown below
You can see above that the version is now showing as 15.0.1 with JRE
4. Uninstalling the JDK on macOS
To uninstall the JDK from macOS, you need to have administrator privileges on your system.
Go the path below in your mac system and delete the correct version by verifying the version number after the JDK as shown below
This will uninstall the JDK 15 from your mac System.
5. Summary
In this article, we discussed how to download and install the latest version of Java Runtime Environment and JDK on Mac OS and learned the new features of it. We talked about the system requirements for installing JDK15. Also, we discussed the step-by-step process for download, installing and uninstalling the java 15 version on macOS.