Skip to content
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

not handling javac 10 and 11 #510

Closed
ghost opened this issue Oct 5, 2018 · 2 comments
Closed

not handling javac 10 and 11 #510

ghost opened this issue Oct 5, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 5, 2018

Issue description

cordova run android --emulator is not working on java installed via brew (both oracle and openjdk versions).

Reproduction

  • On mac os 10.13.6:
  • npm module cordova-android 7.0.0 (installed automatically by cordova platform add android)

oracle

  • brew install oracle_java
  • cordova run android --emulator
  • fix the JAVA_HOME envvar
  • getting UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater

openjdk

  • brew tap brew tap AdoptOpenJDK/openjdk
  • brew install adoptopenjdk-openjdk11
  • fix the JAVA_HOME envvar
  • getting UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater
  • i know this is not brew cask, it's a third party brew tap, but as we speak the guys at adoptopenjdk are working on pull request to official brew cask for openjdk

Investigation

As far as I discovered file check_reqs.js is responsible, it has problem recognising java10 and java11 because javac -version outputs to stdout instead of stderr. Also the regex.

@dpogue
Copy link
Member

dpogue commented Oct 5, 2018

As far as I know, the Android tools require Java 8 and are not compatible with newer versions.

@raphinesse
Copy link
Contributor

raphinesse commented Oct 5, 2018

@odrzutowiec The Problem with check_reqs.js has already been fixed in #446 but the fix has not been released yet.

However, as @dpogue said: The Android tools require Java 8 (exactly). You can make it work with newer versions in some scenarios but it's generally not worth the trouble.

You can try to verify this using cordova@nightly and cordova-android@nightly. You then should get the message Requirements check failed for JDK 1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants