Easy to follow details about how to install OpenJDK are available here.
As I’m writing this, Java 11.0.4 is the latest version and AdoptOpenJDK is one of the best places to find Prebuilt OpenJDK Binaries. Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that. Looking for how to install Java on Big Sur? Please take a look over here.