简体   繁体   中英

Requirements check failed for JDK 1.8.x! Detected version: 3.0.0

I am trying to build a quasar cordova app for Android. when I run the command quasar dev -m cordova -T android I get the error:

Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=C:\Users\myUserName\AppData\Local\Android\Sdk (recommended setting) ANDROID_HOME=C:\Users\myUserName\AppData\Local\Android\Sdk (DEPRECATED) Requirements check failed for JDK 1.8.x: Detected version. 3.0.0 Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

App · Command "cordova" failed with exit code: 1 App · Updated Cordova config.xml App · ⚠️ [FAIL] Cordova CLI has failed

It says I need JDK 1.8.x, but it detected 3.0.0. But I am pretty sure I have JDK 1.8 installed, when I run the bash shell command java -version I get: Picked up JAVA_TOOL_OPTIONS: -Xmx3g -Xms2g java version "1.8.0_291" Java(TM) SE Runtime Environment (build 1.8.0_291-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)

at C:\Program Files\Java I have two folders: jdk1.8.0_291 and jre.18.0_291

my JAVA_HOME environment variable is set to C:\Program Files\Java\jdk1.8.0_291

I have no idea why I can't get the app to build. Please help!

I had the environment variable JAVA_TOOL_OPTIONS set to something. After clearing the variable and trying again, everything worked. I read it may be due to the regex used by Execa failing to detect the correct version when using JAVA_TOOL_OPTIONS.

I had to remove "C:\Program Files\Common Files\Oracle\Java\javapath" as an entry in my PATH variables to get around this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM