question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cordova isn't detecting java 8 jdk when a more recent version is installed

See original GitHub issue

Cordova 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
breautekcommented, May 7, 2021

I ended up downgrading from Android Studio 4.2.0 to 4.1.3 and it’s working again for me. Would it be possible to allow this version of the JDK given they have bumped their bundled version or is there something else that would block that?

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.

0reactions
ahalbrockcommented, Feb 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found