groovy

Command line option for classpath (--cp/--classpath) is broken on Windows

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2, 1.5.3, 1.5.4
  • Fix Version/s: 1.5.5, 1.6-beta-1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP
  • Number of attachments :
    1

Description

The fix for issue GROOVY-2515 broke the classpath options -cp and -classpath in startGroovy.bat. The options are still evaluated and the classpath is set correctly, but the options are no longer stripped from the command line but passed on to the starter main class. GroovyMain, for example, then finds the option -c in its command line and complains about the missing encoding:

D:\Tmp>groovy -cp test.jar test.groovy
error: no argument for:c
usage: groovy [options] [args]
....

The attached startGroovy.bat fixes this problem. However, I am afraid that it uses features of the set command that are only available in Windows NT and above.

Activity

Hide
Danno Ferrin added a comment -

This patch snuck into my 10954 checkin. Seems to work, so it will stay.

Show
Danno Ferrin added a comment - This patch snuck into my 10954 checkin. Seems to work, so it will stay.
Hide
Paul King added a comment -

Still seems to be broken if there is a space in the classpath (even with quotes). I'll see if I can tweak it further.

Show
Paul King added a comment - Still seems to be broken if there is a space in the classpath (even with quotes). I'll see if I can tweak it further.
Hide
Paul King added a comment -

Too hard for me in the time I have available to make it perfect. I dumbed it down so it shouldn't require NT batch facilities. Also, the workaround is to just use the --classpath variation which handles works with spaces in the classpath.

Show
Paul King added a comment - Too hard for me in the time I have available to make it perfect. I dumbed it down so it shouldn't require NT batch facilities. Also, the workaround is to just use the --classpath variation which handles works with spaces in the classpath.
Hide
Andreas Mayer added a comment -

Although this bug was fixed for release 1.5.5, the release 1.5.6 was still packaged with the buggy revision 11915 of startupGroovy.bat.

Show
Andreas Mayer added a comment - Although this bug was fixed for release 1.5.5, the release 1.5.6 was still packaged with the buggy revision 11915 of startupGroovy.bat.
Hide
Paul King added a comment -

It was in fact a different bug and is covered in GROOVY-2828.

Show
Paul King added a comment - It was in fact a different bug and is covered in GROOVY-2828.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: