The following are the system requirements for installing the JDK and the JRE on macOS:
Set “Use version” to “Java SE 6” and reorder the list in “Java Application Runtime Settings” so “Java SE 6” is first. After you click “Save” and quit, confirm that Java 6 is active by running java -version. On my High Sierra Mac. Java -version gives. Java version '1.8.0172' Java(TM) SE Runtime Environment (build 1.8.0172-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode) but in Oracle's documentation and list of downloads I see references to versions that are much higher, notably 9 or even 10. Oracle is the latest vendor under fire for (ahem) 'potentially unwanted' shovelware. Mac users installing or updating to the latest version Java are finding their shinies infected with the Ask.
Any Intel-based computer running macOS.
Administrator privileges.
You cannot install Java for a single user. Installing the JDK and JRE on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK and JRE on macOS.
When you install the JDK, it also installs the JRE. However, the system will not replace the current JRE with a lower version.
To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.
When you install the JRE, you can install only one JRE on your system at a time. The system will not install a JRE that has an earlier version than the current version.
To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.
Note:
Installing a JRE from Oracle will not update
java -version
symlinks or addjava
to your path. To do this, you must install the JDK.
JDK 9 & Later
Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux areavailable on release-specific pages of jdk.java.net as .tar.gz
or.zip
archives.
As an example, the archives for JDK 13 may be found on jdk.java.net/13 and may be extractedon the command line using
$ tar xvfopenjdk-13*_bin.tar.gz
or
$ unzipopenjdk-13*_bin.zip
depending on the archive type.
JDK 8
Debian, Ubuntu,etc.
On the command line, type:
$ sudo apt-get installopenjdk-8-jre
The openjdk-8-jre
package containsjust the Java Runtime Environment. If you want to develop Javaprograms then please install the openjdk-8-jdk
package.
Fedora, OracleLinux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c 'yum installjava-1.8.0-openjdk'
The java-1.8.0-openjdk
packagecontains just the Java Runtime Environment. If you want to developJava programs then install the java-1.8.0-openjdk-devel
package.
JDK 7
Debian, Ubuntu,etc.
On the command line, type:
$ sudo apt-get installopenjdk-7-jre
The openjdk-7-jre
package containsjust the Java Runtime Environment. If you want to develop Javaprograms then install the openjdk-7-jdk
package.
Fedora, OracleLinux, Red Hat Enterprise Linux, etc.
On the command line, type:
$ su -c 'yum installjava-1.7.0-openjdk'
The java-1.7.0-openjdk
packagecontains just the Java Runtime Environment. If you want to developJava programs then install the java-1.7.0-openjdk-devel
package.
JDK 6
Debian, Ubuntu,etc.
On the command line, type:
$ sudo apt-get installopenjdk-6-jre
The openjdk-6-jre
package containsjust the Java Runtime Environment. If you want to develop Javaprograms then install the openjdk-6-jdk
package.
Fedora, OracleLinux, Red Hat Enterprise Linux, etc.
On the command line, type:
Java For Mac Os
$ su -c 'yum installjava-1.6.0-openjdk'
The java-1.6.0-openjdk
packagecontains just the Java Runtime Environment. If you want to developJava programs then install the java-1.6.0-openjdk-devel
package.
BSD Port
Java Runtime Environment 11
For a list of pointers to packages of the BSD Port forDragonFly BSD, FreeBSD, Mac OS X, NetBSD and OpenBSD, please seethe BSD porting Project's wikipage.