When using ionic to build Android APK, Cordova error is reported: requirements check failed for JDK 1.8 or greater

after the local environment variables of JDK and jre are configured locally, Java, javac and so on can output normally in the command line, but when using ionic cordova build android to package ionic, it will prompt CordovaError: Requirements check failed for JDK 1.8 or greater.

I checked that the local Java version is 10+. Later, I found on the Internet that cordova only supports jdk8, so I need to lower the JDK version to adapt.

Reference links:

https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater

reproduced in: https://www.cnblogs.com/viola-sh/p/9355649.html

Read More: