Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14101

check_reqs.js does not recognize java version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.0.0
    • None
    • cordova-android
    • None
    • OS = Arch Linux

      JAVA = javac 9.0.4

      CORDOVA = 8.0.0

    Description

      The java version  i am using produces following output.

      > javac -version 
      javac 9.0.4
      
      

       

      The error happens in two points:

      // 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];
      });

      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

      Attachments

        Issue Links

          Activity

            People

              raphinesse Raphael von der Grün
              voidargon Arne Simon
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: