To go along with a previous post about automating Oracle Java 8 updates, I’ve now posted a script to download and install the latest Java 8 Java Development Kit (JDK) from Oracle. Oracle has been releasing two separate versions of Java 8 simultaneously, so this script is designed to allow the user to set which version they want to install: the CPU release or the PSU release.
The difference between CPU and PSU releases is as follows:
- Critical Patch Update (CPU): contains both fixes to security vulnerabilities and critical bug fixes.
- Patch Set Update (PSU): contains all the fixes in the corresponding CPU, plus additional fixes to non-critical problems.
For more details on the differences between CPU and PSU updates, please see the link below:
http://www.oracle.com/technetwork/java/javase/cpu-psu-explained-2331472.html
For more information, see below the jump.
The script below will download a disk image containing the latest version of the Java 8 JDK from Oracle and install the JDK using the installer package stored inside the downloaded disk image.
How the script works:
- Uses curl to download a disk image containing the latest Java 8 JDK installer from Oracle’s web site
- Renames the downloaded disk image to java_eight_jdk.dmg and stores it in /tmp
- Mounts the disk image silently in /tmp. The mounted disk image will not be visible to any logged-in user.
- Installs the latest Java 8 JDK using the installer package stored inside the disk image.
- After installation, unmounts the disk image and removes it from the Mac in question.
I’ve posted the script to my GitHub repo at the following address:
This script is also available as two separate payload-free installer packages, compressed and stored as .zip files inside the payload_free_installer directory:
- payload_free_installer/install_latest_oracle_java_jdk_8_cpu_version – Installs the latest Oracle Java JDK 8 CPU version
- payload_free_installer/install_latest_oracle_java_jdk_8_psu_version – Installs the latest Oracle Java JDK 8 PSU version