
Osvers= $(sw_vers -productVersion | awk -F. # This script downloads and installs the latest Oracle Java 7 for compatible Macs After installation, unmounts the disk image and removes it from the Mac in question.Installs the latest version of Java 7 using the installer package stored on the disk image.The mounted disk image will not be visible to any logged-in user. Mounts the disk image silently in /tmp.Renames the downloaded disk image to java_seven.dmg and stores it in /tmp.Uses curl to download a disk image containing the latest Java 7 installer from Oracle’s web site.
#ORACLE JAVA 7 DOWNLOAD FOR MAC INSTALL#
The script below will download a disk image containing the latest version of Java 7 from Oracle and install Java 7 using the installer package stored inside the downloaded disk image.

#ORACLE JAVA 7 DOWNLOAD FOR MAC UPDATE#
It uses Java 7’s update feed to install the latest Java and Oracle has recently updated the feed to begin providing Java 8 to Java 7 users: Update 3-6-2015: This script has been retired and should no longer be used to install Java 7. Using this information, I was able to build a script that can download and install the latest Java 7 update. As part of my testing, I verified that using the SUFeedURL value for Java 7 Update 15 and 65 will also work to pull the address of the latest Oracle Java 7 installer disk image. One of the important things I was able to establish is that the XML address embedded with Java 7 Update 67 is not special in this regard. The following XML was returned and I was gratified to see that it contained a download link to a Java 7 Update 67 disk image. I decided to see what output would come back from Oracle’s site when accessed, so I used the following curl command to see what was returned: The output I received for Java 7 Update 67 was the following: I checked that value using the following command:ĭefaults read "/Library/Internet Plug-Ins/ugin/Contents/Info" SUFeedURL The only address I could find in that regard was the SUFeedURL value included in Java 7’s /Library/Internet Plug-Ins/ugin/Contents/ist file. Oracle does provide a Sparkle-based update mechanism for Java 7 on OS X, so I wanted to see if there was a way to leverage that to pull down updates.

AutoPkg handles its update task by scraping Oracle’s manual download page for the current correct URL to use. Oracle didn’t make this an easy task, as the download URL seems to change on a per-update version.

I’ve been using AutoPkg to download the latest Java 7 updates using AutoPkg’s OracleJava7 recipes, but I wanted to develop a script that would do the following: Something I’ve wanted to do for a while was to write a script to download and install the latest Java 7 update from Oracle.
