JDK 14 and macOS Catalina – issue with unidentified developer

After installing JDK 14, as soon as you try to compile simple Hello world! application you will notice following issue

“jdk-14.jdk” is damaged and can’t be opened

This issue can be solved by moving Info.plist into backup file (e.g. one with ~ at the end).

> cd /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents
> sudo mv Info.plist Info.plist~

However, this will not solve your problems completely. There is one more thing to do. If you try to execute javac, after this small “fix”

> /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/javac

you will be shown the message

“classes.jsa” cannot be opened because the developer cannot be verified.

Press Cancel as many times as needed (don’t Move to Bin). Then open

System Preferences -> Security & Privacy -> Allow Anyway

Run javac again. This time, you will get yet another warning.

macOS cannot verify the developer of “classes.jsa”. Are you sure you want to open it?

As you can see you are now free to Open application.

You can also take alternative path by removing com.apple.quarantine from the files that are coming with JDK installation.

> xattr -l /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/javac
com.apple.quarantine: 0082;5e42e60f;Safari;

As you can see, in my case all the downloaded files were put into quarantine by Safari. You can remove this attribute following way

> sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/jdk-14.jdk/

and you are ready to go

> /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/javac Hello.java
> /Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin/java Hello
Hello world!

Have fun!