To install Java on MacOS you need to go to the official Oracle download page and click on the major version of Java.
Press “JDK Download” link and scroll down and download macOS Installer.
When downloading is finished launch dmg file and double-click on the icon.
Look for the Java Preferences app on your Mac in Applications Utilities Java J2SE 5.0 (cmd-shift-U opens Utilities). If the J2SE 5.0 directory is missing, Download the latest Java 1.5.0 from Apple. About: Adobe Acrobat Reader DC software is the free global standard for reliably viewing, printing, and commenting on PDF documents. And now, it's connected to the Adobe Document Cloud − making it easier than ever to work across computers and mobile devices. Use Software Update available on the Apple menu to check that you have the most up-to-date version of Java 6 for your Mac. Java 7 and later versions are not supported by these older versions of Mac OS X. If you have problems with Java 6, contact Apple Technical Support. Java.com does not provide a download for these systems. Download Java for OS X 2017-001 Java for macOS 2017-001 installs the legacy Java 6 runtime for macOS 10.13 High Sierra, macOS 10.12 Sierra, macOS 10.11 El Capitan, macOS 10.10 Yosemite, macOS 10.9 Mavericks, macOS 10.8 Mountain Lion, and macOS 10.7 Lion. Download The Unarchiver for macOS 10.9 or later and enjoy it on your Mac. The Unarchiver is a small and easy to use program that can unarchive many different kinds of archive files. It will open common formats such as Zip, RAR (including v5), 7-zip, Tar, Gzip and Bzip2.
Java installer welcome page will be opened.
Press “Continue”.
Press “Install”.
So Java is successfully installed and ready to use.
To check Java version you need:
- Open Launchpad
- Find and open Terminal
- Type java -version
Drjava Ide
Output:
Drjava Exe
P.S. check my guide how to add $JAVA_HOME environment variable on Mac OS.