FabianTe opened a new issue #623: Java version check does not print detected 
version to console
URL: https://github.com/apache/cordova-android/issues/623
 
 
   Hi!
   
   Disclaimer: I am unsure if this is the correct repository, feel free to 
guide me to the correct spot if I am lost 😉 
   
   So, When using Cordova and having Java 11 and Java 8 installed on my Windows 
machine, running `cordova emulate android` will output this error many people 
know: 
   
   ```
   ANDROID_HOME=C:\Users\fabit\AppData\Local\Android\Sdk
   JAVA_HOME=C:\Program Files\Java\jdk1.8.0_202
   Requirements check failed for JDK 1.8
   ```
   
   I then thought "hmm, but my `JAVA_HOME` is pointing to the correct JDK, 
version 8.
   Running the command with `--verbose` showed my that in fact Cordova checks 
not the ENV variable but some other. This happens in this function:
   
   
   This can be found here: 
https://github.com/apache/cordova-android/blob/d9c08f12a7bceb47ee97ca8ca0e75548e78f999d/bin/templates/cordova/lib/check_reqs.js#L355-L369
   
   As you can see, the check is happening on `values[0]`, not the `JAVA_HOME` 
ENV variable.
   
   This is misleading and caused me (and propably others) to uninstall the 
correct Java version and still getting the error since I didn't suspect Cordova 
picking up Java 11.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to