This basically fixes up the changes from #1220.
* test(env/java): replace test that duplicates implementation
* test(env/java): stub _ensure to focus on unit under test
* test(env/java): add test for invalid output
* refactor(env/java): keep try block small
* refactor(env/java): shorten excessive comment
* fix: Java version parsing if java executable prints out additional information with --version
* fix: Ensure JAVA_HOME path comes first in the PATH environment
* refactor: Removed redundent code in favour of keeping a change introduced from another PR
Co-authored-by: エリス <erisu@users.noreply.github.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/java.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/java.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update bin/templates/cordova/lib/utils.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update bin/templates/cordova/lib/check_reqs.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/check_reqs.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Update spec/unit/check_reqs.spec.js
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>
Co-authored-by: Raphael von der Grün <raphinesse@gmail.com>