How to run an app that require Java SDK on macOS Catalina 10.15?

Open System Preferences -> Security & Privacy -> General, there should be a message about the JDK app, click Allow.

Run the Java-based app again (e.g.: type java -version in the Terminal app). A dialog should appear confirming you trust OpenJDK.

Source: https://apple.stackexchange.com/a/372235/35845


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 :)


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)

I tried master-disable but the problem reoccured after a reboot. In my particular situation, brew isn't what I want either.

Only solution I've found that works for me is

xattr -d com.apple.quarantine /Library/Java/JavaVirtualMachines/openjdk1.8.0<version>/