Cordova isn't detecting java 8 jdk when a more recent version is installed
See original GitHub issueCordova isn’t detecting java 8 jdk when a more recent version is installed. Even when the JAVA_HOME env var is properly set :
PS C:\Users\***\workspace\prestas\***\cordova-poc\in-app-browser> cordova run android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\***\AppData\Local\Android\Sdk\platforms\android-30 (recommended setting)
ANDROID_HOME=C:\Users\***\AppData\Local\Android\Sdk (DEPRECATED)
Requirements check failed for JDK 1.8.x! Detected version: 15.0.1
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
PS C:\Users\***\workspace\prestas\***\cordova-poc\in-app-browser> $Env:ANDROID_SDK_ROOT
C:\Users\***\AppData\Local\Android\Sdk\platforms\android-30
PS C:\Users\***\workspace\prestas\***\cordova-poc\in-app-browser> $Env:JAVA_HOME
C:\Program Files\Java\jdk1.8.0_291
Cordova version : 10.0.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cordova : Requirements check failed for JDK 1.8 or greater
Open environment variables, create an environment variable called JAVA_HOME and set value to JDK install path. C:\Program Files\Java\jdk1.8.0_162 make sure you ...
Read more >How to find Java version in Windows or Mac - Manual method
Learn how to find which Java version(s) are installed without running an applet on Windows or Mac.
Read more >Unable to install android though ionic
Cordova (or Android tooling) only works with JDK(1.)8, not 9 or 10. Install that, then it will work.
Read more >Getting Started with Cordova Applications - Apache NetBeans
Download and install Node.js, if not already installed. ... You can run the following command to update Cordova to the most recent version....
Read more >Install Cordova on Windows - Evothings
This document describes how to install Apache Cordova and the Android SDK on a ... Download the recent version of Java SE JDK...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It’s tricky, because AS tooling 4.1 and lower doesn’t work on Java > 8. AS tooling 4.2 as you experienced, requires at least Java 11 and will not work on Java 8.
Good news is, we can probably upgrade to Java 11 now for the next major release.
Just adding some info. I am running on Mac and was using /usr/libexec/java_home to set $JAVA_HOME env variable and specifying -v 1.8 as I also have Java 11 jdk installed but was running into this issue. In the end I didn’t realize I also had a Java 8 JRE installed and it was automatically choosing that, so not overwriting the javac to be the 1.8 version, causing the java version check issues. After being more specific, -v 1.8.0_221, it properly copied over the 1.8 jdk stuff and now the project compiles.