Currently I am getting issue with new macOS Catalina limitation. Every time I run an app that require openJDK I get this message:

"openjdk-12.0.1.jdk" can’t be opened because it is from an unidentified developer.

Your security preferences allow installation of only apps from the App Store and identified developers.

But if I use the recommended way to bypass this issue (by going to System Preferences → Security & Privacy → General → Open Anyway button) it just opens the JDK folder. Which is not what I want.

How I can use JDK with macOS Catalina?


A solution, not sure if that's the only solution & the better one, is to run

sudo spctl --master-disable

Then run your app (validation will be kept by macOS Gatekeeper)

and right after that re-enable Gatekeeper with

sudo spctl --master-enable

This last step is important to keep you Mac safe :)

  • Well, disabling system protection is never going to be a good option, but I can't see another way around for now. Hopefully OpenJDK will be updated soon enough to resolve this issue. – Rafael Soares Jul 5 at 2:12

After testing different options, pinning to the latest LTS cask worked for me. (edit: you will need to add the tap to show previous cask versions)

brew tap homebrew/cask-versions
brew cask install java11

Here's the output I get afterwards on Catalina Public Beta 2

java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .