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

lib/check_reqs.js fails if javac returns an extra line

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.0
    • None
    • cordova-android
    • ubuntu 14.04, cordova 5.1.1, cordova android@4.1.0

    Description

      lib/check_reqs.js fails with

      [TypeError: Cannot read property '1' of null]

      if javac returns an extra line(s) instead of a single line.

      For example:

      Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
      javac 1.7.0_79

      instead of simply

      javac 1.7.0_79

      The fix is quite simple:

      --- check_reqs.js-	2015-07-29 14:21:54.000000000 +0300
      +++ check_reqs.js	2015-07-29 16:11:29.000000000 +0300
      @@ -155,7 +155,7 @@
                   // javac writes version info to stderr instead of stdout
                   return tryCommand('javac -version', msg, true);
               }).then(function (output) {
      -            return /^javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
      +            return /javac ((?:\d+\.)+(?:\d+))/i.exec(output)[1];
               });
           });
       };
      

      i. e. remove leading caret at the parsing regular expression, so it is not anchored to a beginning of a string.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            vladimir.kotikov Vladimir Kotikov
            vadp Vadim Shlyakhov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment