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

invoking groovy with -D seems to mess up main's args in some cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.8.2
    • None
    • None
    • Ubuntu 11.04 amd64, 64-bit sun java

      java version "1.6.0_27"
      Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
      Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

    Description

      Put this code in A.groovy

      class A
      {
          public static void main(String[] args) {
      	args.each { println it }
          }
      }
      

      Run

      groovy -Da=b A.groovy -no-file
      

      Actual output:

      -n
      o-file
      

      Expected output:

      -no-file
      

      Omitting the -Da=b causes the arguments to be processed correctly. It appears that groovy's startup script is calling java correctly. In other words, running this command:

      /opt/jdk/bin/java -classpath /opt/groovy/lib/groovy-1.8.2.jar -Dscript.name=/opt/groovy/bin/groovy -Dprogram.name=groovy -Dgroovy.starter.conf=/opt/groovy/conf/groovy-starter.conf -Dgroovy.home=/opt/groovy -Dtools.jar=/opt/jdk/lib/tools.jar org.codehaus.groovy.tools.GroovyStarter --main groovy.ui.GroovyMain --conf /opt/groovy/conf/groovy-starter.conf --classpath . -Da=b A.groovy -no-file

      results in the same output.

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              ejb@ql.org Jay Berkenbilt
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: