Core Java

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

java runtime environment mac - installer for jdk15
Downloading the macOS installer for JDK15

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.

java runtime environment mac - license agreement
Accepting the License Agreement

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

java runtime environment mac - java version check
Java Version Check

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

java runtime environment mac - unistalling jdk15
Uninstalling JDK 15

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.

Shankar Mata

Shankar works as a Lead Software Engineer in a leading company and has developed several applications. He is one of the decision makers for the design and architecture for all the applications in his team. He along with his team develop and deploy cloud native services. He had been working in the field of Java and cloud technologies. He is also Amazon and Microsoft certified solution architect for AWS and Azure respectively. He has done his Masters in Computer science from University of New Mexico, US and Bachelors from GITAM University India. He is also experienced in Angular Framework and developed several applications.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button