cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-14101) check_reqs.js does not recognize java version
Date Sun, 03 Jun 2018 01:21:00 GMT

    [ https://issues.apache.org/jira/browse/CB-14101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499251#comment-16499251
] 

ASF GitHub Bot commented on CB-14101:
-------------------------------------

raphinesse opened a new pull request #446: CB-14101 Fix Java version check for Java >=
9
URL: https://github.com/apache/cordova-android/pull/446
 
 
   ### Platforms affected
   Android
   
   ### What does this PR do?
   - Fix Java version check for Java >= 9
   - Checks that we have exactly Java 1.8 since nothing else works with the Android SDK
   - Tell the user that we need exactly Java 1.8 if we can't find it
   
   ### What testing has been done on this change?
   The relevant function was not covered by unit tests to begin with, so I only tested this
manually with the following code:
   ```js
   Promise.resolve(
     require('./bin/templates/cordova/lib/check_reqs').check_java()
   ).then(console.log)
   ```
   Output for Java 8 is `true`, for Java 10 is `false`.
   
   ### Checklist
   - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA
database
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file
paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
   
   ~~Added automated test coverage as appropriate for this change~~
   

----------------------------------------------------------------
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:
users@infra.apache.org


> check_reqs.js does not recognize java version
> ---------------------------------------------
>
>                 Key: CB-14101
>                 URL: https://issues.apache.org/jira/browse/CB-14101
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android
>    Affects Versions: 8.0.0
>         Environment: OS = Arch Linux
> JAVA = javac 9.0.4
> CORDOVA = 8.0.0
>            Reporter: Arne Simon
>            Assignee: Raphael
>            Priority: Major
>
> The java version  i am using produces following output.
> {code}
> > javac -version 
> javac 9.0.4
> {code}
>  
> The error happens in two points:
> {code:java}
> // We use tryCommand with catchStderr = true, because
> // javac writes version info to stderr instead of stdout
> return tryCommand('javac -version', msg, true).then(function (output) {
>   // Let's check for at least Java 8, and keep it future proof so we can support Java
10
>   var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
>   return match && match[1];
> });{code}
> 1. _platforms/android/cordova/lib/check_reqs.js:218_
> The comment states that javac prints to stderr, this is not true on my system it prints
to stdout!
> 2. _platforms/android/cordova/lib/check_reqs.js:220_
> The regex only looks after version numbers like 1.8 or 1.9 or 10, but the version number
my java version prints is _9.0.4_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message