Updated March 22nd, 2021.
If you’re seeing a pop-up that says “To use the java command-line tool you need to install a JDK” and left wondering “How do I do that?” this is the article for you.
For macOS Catalina and higher
- Go to Oracle’s Java downloads page. Look for the highest-numbered version, probably near the top of the page. As of Monday, March 22nd, 2021, it’s Java SE 16. Click JDK Download.
- Download the Mac installer. (You want this one: jdk-16_osx-x64_bin.dmg. Do not get the one with “tar” in the name– it won’t work.)
- Run the installer.
You will have to create an “Oracle Account” in order to download. Sort of a drag but you can’t do the download if you don’t create an account.
That’s all there is to it.
For macOS 10.14 and older
Some older Mac apps (Adobe’s Photoshop is one) require Java in order to work. Java is not part of the macOS so it has to be installed manually. The problem is, the modern Java installer puts Java into a different location than it used to, so when these older apps look for Java, they don’t find it, even though it’s there– because they are looking in the wrong place.
The solution is to install an older version of Java, with an installer that puts things where Adobe expects to find them.
You would think that clicking the “More Info…” button in the “you need to install a JDK” pop-up would take you to a page where you could download the proper version of Java… but that’s not the case. The “More Info…” button takes you to the page for the latest version of Java, not the older one.
Click here to go to the older, “Legacy” Java installer page on Apple’s website. You’ll see a picture of a lion. That’s because Lion (10.7) was the current macOS when that version of Java came out.
Download the installer from that page, run the installer, and you’re done. No more annoying pop-up.
Speaking of pop-ups…
If you have an HP printer, and are using Catalina or Big Sur, you may be getting pop-ups saying things like “This HP software may damage your computer.” Scary stuff! Here’s my article that tells you how to solve that problem.