Cannot get JDK 1.8

Running the command cordova build android to use Cordova to build an Android app failed.

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home
Requirements check failed for JDK 1.8

How to get JDK 1.8?