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

Groovy 1.5.6 Windows startGroovy.bat fails to pass CLASSPATH to groovy starter

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.6-beta-1, 1.5.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP

      Description

      The startGroovy.bat file supplied with Groovy 1.5.6 does not pass the System CLASSPATH variable onto the GroovyStarter class. The Unix startGroovy does the following -

      if [ -n "$CP" ] ; then
      CP="$CP":.
      elif [ -n "$CLASSPATH" ] ; then
      CP="$CLASSPATH":.
      else
      CP=.
      fi

      The Windows startGroovy.bat does -

      if "x" == "x%CP%" goto empty_cp
      :non_empty_cp
      set CP=%CP%;.
      goto after_cp
      :empty_cp
      set CP=.
      :after_c

      Note , the CLASSPATH variable is ignored.

      I think this issue is the result of the fix for issue GROOVY-2644. In 1.5.5 the equivalent bit of script did the following -

      if "x" == "x%CP%" goto empty_cp
      :non_empty_cp
      set CP=%CP%;.
      goto after_cp
      :empty_cp
      set CP=.
      if "x" == "x%CLASSPATH%" goto after_cp
      set STARTER_CLASSPATH=%STARTER_CLASSPATH%;%CLASSPATH%
      :after_cp

      So, the CLASSPATH in 1.5.5 was passed on via the STARTER_CLASSPATH to the Java executable.

      Suggest that the correct script should be -

      if "x" == "x%CP%" goto empty_cp
      :non_empty_cp
      set CP=%CP%;.
      goto after_cp
      :empty_cp
      set CP=.
      if "x" == "x%CLASSPATH%" goto after_cp
      set CP=%CLASSPATH%;%CP%
      :after_cp

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              jimbobfromhell Jim Speakman
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: