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?

  • Could it be an issue with notarization? Did you try to notarize your app? – WallTearer Sep 26 '19 at 12:08

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

  • 2
    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 '19 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)
  • ℹ️This doesn't work for brew cask install java6 – Mikeumus Sep 16 '19 at 1:46
  • 1
    @Mikeumus the post clearly states "pinning to the latest LTS cask worked"; java6 is not the latest LTS, java11 is. please consider removing a downvote as a help to others. disabling gatekeeper is not a great option. – Chad Stovern Sep 17 '19 at 4:23
  • I'm sorry, I didn't downvote Chad 😄imgur.com/a/8maWkjP I left this note here for people looking to get java6 working and winding up here. I have my own Q/A for java6 here: apple.stackexchange.com/questions/370141/… – Mikeumus Sep 17 '19 at 19:01
  • There, have an upvote! 🔼3️⃣👋 – Mikeumus Sep 17 '19 at 19:29
  • 1
    gotcha thanks for clarifying; def not fishing for upvotes; merely hoping to avoid having people disable security on their Macs, that the other popular answer is advocating for. – Chad Stovern Sep 20 '19 at 14:08

You must log in to answer this question.

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