Can't run OpenJDK macOS Catalina "Can't verify it's not a Virus"
Go to System Settings -> Security &amp; Privacy -> General -> click 'Allow' (below 'App-Downloads allowed from')

After that open a terminal and run java again (e.g. java -version).
A new Dialog should appear with the possibility to trust OpenJDK futurewise.