macOS: Verify Java JRE Download via SHA256 Checksum
In this short post I want to show how you can verify your Java Runtime Environment (JRE) download, or any other for which checksums are provided, via your Macs terminal.
Download Java
First of all you have to download the Java JRE, which can be found directly at Oracle’s website. Here an example on how it looked like when I downloaded it.
After hitting “DOWNLOAD” you will be forwarded to a site with a list of all available files for the different operation systems out there. Right above this list is a link that will open up the page with the checksums.
First you want to download the file, next you open the page with the checksums and make note of the corresponding checksum. Here I marked the relevant ones for macOS.
Checksum by Code
This example shows the command we will use next.
// Command | |
openssl dgst -<digest> <file> | |
// Example | |
openssl dgst -sha256 jre-8u231-macosx-x64.dmg | |
// Output | |
SHA256(jre-8u231-macosx-x64.dmg)= 6bf818fe04866da07e6272b5ccfabff9e773713026d2fae714971e73568bfe4d |
Open a terminal (cmd + space and type Terminal, select Terminal and hit Enter) and cd to the folder where you saved the Java Runtime Environment. Copy & paste the command and replace the “<file>” placeholder with the filename.
Now you can compare the output with the checksum from above and at least you will know that your download matches the information on the website, not 100% safe, but better than nothing.