jdk 11 was fine on my mac os Mojave. On upgrading to Mac OS Ventura, I started seeing this popup error:
openjdk-11.0.2 is damaged and can't be opened.I uninstalled and reinstalled openjdk11 using brew but still get the same error:
$ brew uninstall openjdk@11
Uninstalling /usr/local/Cellar/openjdk@11/11.0.16.1_1... (678 files, 298.8MB)
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
1.8.261.12 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_191 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
$ brew install openjdk@11
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/manifests/11.0.16.1_1
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/66d77b9adc57a7f85fca1b4c90e6187f64aa336a0777d7dc1014151d925df3d8--openjdk@11-11.0.16.1_1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/blobs/sha256:4157114f6dd128b93d0732559787f191678d2d496476e19855a03d0f226aa50c
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/853c10b19f8f8cd779b49261c60a74abf52e9fea1067d934c45549bea2b8ed3e--openjdk@11--11.0.16.1_1.ventura.bottle.tar.gz
==> Pouring openjdk@11--11.0.16.1_1.ventura.bottle.tar.gz
==> Caveats
For the system Java wrappers to find this JDK, symlink it with
sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
openjdk@11 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have openjdk@11 first in your PATH, run:
echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> /Users/user/.bash_profile
For compilers to find openjdk@11 you may need to set:
export CPPFLAGS="-I/usr/local/opt/openjdk@11/include"
==> Summary
� /usr/local/Cellar/openjdk@11/11.0.16.1_1: 678 files, 298.8MB
==> Running `brew cleanup openjdk@11`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).