

To re-enable System Integrity Protection, follow exactly the same procedure except type: csrutil enable.

Your Mac will then restart with SIP disabled and you can try installing Java again.

If you’re not sure whether Java is installed on your Mac, simply search for Terminal in Spotlight and type: java -version at the command prompt. If you’ve never installed Java on Mac, then you can simply download and install the latest version of Java from Oracle which is known as Java 8 but rather confusingly officially called Java 1.8 by Oracle. It’s because an application you have installed or a website you’re trying to access requires Java to launch or work properly. To use the “java” command line tool you need to install a Java SDK
