-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java version check does not print detected version to console #623
Comments
I added a |
Ugh, why does it output that ENV var there then at all? Do you have a suggestion for better output here that would actually help users to understand what is going on? (besides just outputting the compared value like in your PR?) |
Well, I could rewrite it to display "Checking your Java and Android SDK version". Printing the ENV variable isn't correct. Looks like in my case, there was more to it, i fixed my error: As mentioned above I have Java 11 and 8 installed. What I just now found was, that I hat a |
I think it is good to log both the JAVA_HOME setting and the result of |
@brodybits Theoretically it is. But what I have discovered is that these may not correspond to what Cordova checks. Both my ENV variables and the javac --version showed the 1.8 installation. Yet somehow Cordova used my OpenJDK 11 installation. |
Got it now. I think that comment belongs on PR #624 where we are reviewing the actual changes. |
Thank you for your feedback! |
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: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:
cordova-android/bin/templates/cordova/lib/check_reqs.js
Lines 355 to 369 in d9c08f1
As you can see, the check is happening on
values[0]
, not theJAVA_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.
The text was updated successfully, but these errors were encountered: