Macs do not include Java by default so you have to download and install Java on El Capitan & Sierra separately. One of the most common problems users have after upgrading to El Capitan or Sierra is an error message when trying to access certain websites or run apps that require Java and this tutorial helps fix that. There are also issues regarding legacy support for Java 6 in OS X 10.12 Sierra which we clarify at the end of the article. Note that we don’t recommend you install Java unless absolutely essential because it’s notoriously unstable and insecure and once installed, you can’t ever fully uninstall Java from a Mac. However, if you’re one of those people that has no choice because the website you need to access, application you want to use or the game you want to play requires it, follow these instructions.
How To Install Java On El Capitan & Sierra
If you’ve upgraded to El Capitan or macosSierra and keep receiving the error message pop up:
To use the “java” command line tool you need to install a Java SDK
It’s because an application you have installed or a website you’re trying to access requires Java to launch or work properly. 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.
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 Java is on your Mac, you’ll see a message saying something like “Java (TM) Runtime Environment” in this case version 1.6 (or Java 6 as it is commonly known). If you find that you already have Java 1.6 installed, scroll down below “How to update Java 6 in El Capitan” as you also need to install a special update from Apple.
Java Installation Problems in El Capitan & Sierra
If you run into problems during the installation of Java, it’s because Apple has added an extra layer of security to Macs known as Rootless SIP. Java has such a bad rep on Macs that Apple has made it increasingly difficult to install it and other things that can potentially damage OS X. If your Mac is blocking the installation of Java, follow these instructions to disable rootless SIP and try again:
- Restart your Mac when the screen turns black hold down ⌘R until the Apple logo appears.
- Select the “Utilities” menu and then “Terminal”. In Terminal type: csrutil disable
- Hit Return and then restart OS X. Your Mac will then restart with SIP disabled and you can try installing Java again.
- To re-enable System Integrity Protection, follow exactly the same procedure except type: csrutil enable
- Rootless SIP is then renabled on your Mac.
Note: You will have to deactivate SIP when new updates for Java are released as Java will not update while SIP is enabled.
How To Update Java 6 On Mac
If you find that Java apps or applets will either refuse to run or open briefly before crashing giving you an error message such as “This application requires the legacy Java SE 6 runtime which is unavailable for this version of OS X”:
or the Java applet crashes with an error message such as:
com.apple.xpc.launchd: (com.apple.xpc.launchd.oneshot.0x10000004.OSXJavaLauncher) Service exited with abnormal code: 1
It’s because some applications, games and websites still only work with Java 6. Examples of people that may still need Java 6 are those trying to access some government sites, some online games and Android programmers that require Java 6 to develop Android apps on Mac. If you’re having problems running Java 6 on your Mac in El Capitan then you simply need to install Apple’s legacy Java 6 OS X 2015-001 update. This is a special update from Apple which allows the outdated Java 6 to safely run on your Mac. In the release notes for the Java 6 update, Apple states:
Java for OS X 2015-001 installs the legacy Java 6 runtime for OS X 10.11 El Capitan, OS X 10.10 Yosemite, OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, and OS X 10.7 Lion. This package is exclusively intended for support of legacy software and installs the same deprecated version of Java 6 included in the 2014-001 and 2013-005 releases.
To install the update, you must quit any Java applications that are running and then simply download and double click on the Jave 6 update file and the update will automatically install. If you run into problems during installation, you’ll need to disable Rootless SIP protection in OS X (see above). Note that Java 6 does not officially work with OS X 10.12 Sierra although some users have had success with it so it may work and it seems to depend on the specific app you need it for.
Support For Java 6 In OS X Sierra
The bad news for those that need Java 6 on OS X 10.12 Sierra is that it is no longer officially supported on anything higher than OS X 10.11 El Capitan. Due to various security and support issues, last year Apple announced plans to discontinue any support for Java 6 in future versions of OS X:
OS X v10.11 is the last major release of OS X that will support the previously deprecated Java 6 runtime and tools provided by Apple. Applications or features that depend upon Java 6 may not function properly or will not launch when Java 6 is removed. Developers should move to a newer version of Java as provided by Oracle.
However the Apple link that Oracle refers users to has now been removed by Apple leaving some doubt as to whether Apple has had a change of heart regarding support for Java 6 on Sierra. Some Mac users are reporting that you can still install Java 6 on Sierra and it works for some apps but not for others. In the case of Cyberduck for example, it seems that the developer has updated the app to work with Java 6 in Sierra so it may well be down to individual developers whether they force their apps to work with it. Our advice is don’t rely using Java 6 on Sierra until Apple clarify whether it will be officially supported. Java 7 and 8 are officially supported in OS X 10.12 Sierra and if you don’t need Java 6, we highly recommend updating to Java 7 or 8 because Java is notoriously insecure and older versions are particularly vulnerable to attack and bugs.
As stated in the introduction, if it’s not necessary to you, you’re better off not installing Java at all on your Mac as it’s an increasingly antiquated platform that often causes more problem’s than it’s worth. And you can never fully remove Java from a Mac although you can find instructions how to disable Java on your Mac here.
If you have any other problems running Java in El Capitan or Sierra on your Mac, let us know in the comments below.