This article will show you how to deinstall all preinstalled JDK from the mac OS and then install OpenJDK 11 on it. I used macOS Big Sur (11.7.2) as example.
TL;DR
sudo rm -fr /Users/yourUserName/Library/Java/JavaVirtualMachines/*
sudo rm -fr /Library/Java/JavaVirtualMachines/*
/bin/bash -...