Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8231

Getting syntax error when setting classpath with *

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.11
    • None
    • OS: Windows 10
      JDK: 1.8.0_66 x64

    Description

      I am running a simple hello world style script.
      The working directory has the following structure:

      .
      |-- lib
      |   |-- commons-io.jar
      |   `-- commons-lang3.jar
      `-- src
          |-- Main.groovy
          `-- a
              `-- pkg
                  `-- Hello.groovy
      

      I am trying to run the following command:
      groovy --classpath ".\lib*;.\src" src\Main.groovy

      The error I get is: "The syntax of the command is incorrect."

      Digging a little bit in the batch files called I traced the problem to bin\startGroovy.bat, specifically in :win9xME_args_slurp.
      In that block, there is an attempt to replace * in various situations however my case uses \ (and /) which is not covered.
      It seems to me that this is a rather common use case some I think it should be beneficial to add the following 2 lines in the script:

      set _ARGS=%_ARGS:/*=/-s%
      set _ARGS=%_ARGS:\*=\-s%
      

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            abc159abc abc159abc

            Dates

              Created:
              Updated:

              Slack

                Issue deployment