Instead, you need to download a compatible version of Java for mac OS 10.12 directly from Apple.
You can download the Java installer here: Official Apple download: Java for OS X After downloading the file, open the .
This means that installing Oracle Java 7 JDK is a hassle to begin with, and if you blindly accept all of Apple's software updates (that is, you don't remember to uncheck Java updates when they appear) you'll have to re-do parts of your Java 7 installation from time to time because Apple's Java updates reset all the symlinks to point to its own Java 6.
In any case, here's what you need to do to install and use Java 7 on Mac OS X and fix Apples "updates" if they slip by you.
Double click the package installer, enter your password when prompted, and your new Java 7 JDK will be installed in a few minutes. Note To understand the remaining steps you need to understand that Mac OS X is a Unix operating system, and you have to know a little Unix to get certain things done.
WARNING: The version that comes installed on Apple Macs can be obsolete. But if you did, to re-install Java 6 for OS X 2014-001, it can be obtained from https://support.apple.com/kb/DL1572?), then you need to follow the rest of these instructions.If you use an older version of Java, like Apple's Java 6 and try to write programs that use Java class files that were compiled with a newer version of Java you may see an error like this: javap -verbose Location.class | head Classfile /Users/chris/Downloads/Pacman Skeleton/Location.class Last modified Mar 8, 2013; size 1241 bytes MD5 checksum 2e22b98aa3c1fb2bb3a06e5cd4f2fd24 Compiled from Once you've removed all these traces of Apple's Java 6 install, Apple's software update should not (re)install Java 6 and you should only need to reset your symlinks when you install a new JDK from Oracle. Terminal provides you with command shell known as BASH (Bourne Again Shell).However, if you need the latest version of Java (e.g., for Android development) you can download it from Oracle's Java Download Page.Select the Java Runtime Environment version 8u111 for Mac OS X as shown below. This will install the latest build of Java 8 update 111 on your Mac.