7

I recently upgraded my laptop to macOS 10.15.4 and now Java will not run from the command line (or anywhere else from what I can tell) I just see this error message:

“jdk-11.0.2.jdk” cannot be opened because the developer cannot be verified

enter image description here

Giacomo1968
  • 58,727

3 Answers3

15

Try this:

  1. Run Java from the command line and click "Cancel" on the warning
  2. Go to Apple Menu > System Preferences > Security and Privacy > General tab
  3. You should see a button near the bottom of the window allowing you to open Java anyway.

You should only have to do these steps once.

cactus4
  • 177
2

Solved this by using this answer.

  1. Disable the macOS Gatekeeper:

    sudo spctl --master-disable
    
  2. Run the apps that you need to have access to that JDK.

  3. Re-enable the macOS Gatekeeper:

    sudo spctl --master-enable
    

It appears that the permission to open those apps, and verify the developer, is remembered.

Giacomo1968
  • 58,727
Splaktar
  • 131
0

I had to run java from the command line in order to trigger the button in in Security and Privacy to appear when it allowed jdk tools like java and javac to run permanently.

The part that was tripping me up was if I ran the program from Iterm2 https://www.iterm2.com/ which is how I normally run command lines it did not work. I had to run from the built in terminal.

Maybe this is because I am still on bash instead of zsh? At any rate if you run Iterm2 and are having this problem try from the normal system terminal.