groovy
  1. groovy
  2. GROOVY-2084

Joint groovy/java compiler doesn't set classpath correctly when path contains spaces in Windows

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1-beta-2
    • Fix Version/s: 1.1-beta-3
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If you have a path in your classpath that you provide to <groovyc> that contains spaces such as "C:\Documents And Settings\Blah" this causes the classpath to break and compilation errors occur ( on Windows only )

        Activity

        Hide
        Graeme Rocher added a comment -

        Adding some debug, the generating classpath options look like this:

         ["-d", "C:\Documents and Settings\Gr
        aeme Rocher\.grails\0.6-RC1\projects\amazon\classes", "-sourcepath", "C:\Documen
        ts and Settings\Graeme Rocher\.grails\0.6-RC1\projects\amazon\generated-java-sou
        rce", "-classpath", "\"C:\Documents", "C:\sandbox\amazon\src\java\Bar.java"]
        

        The classpath has been completely chopped off after the first space

        Show
        Graeme Rocher added a comment - Adding some debug, the generating classpath options look like this: [ "-d" , "C:\Documents and Settings\Gr aeme Rocher\.grails\0.6-RC1\projects\amazon\classes ", " -sourcepath ", " C:\Documen ts and Settings\Graeme Rocher\.grails\0.6-RC1\projects\amazon\generated-java-sou rce ", " -classpath ", " \ "C:\Documents" , "C:\sandbox\amazon\src\java\Bar.java" ] The classpath has been completely chopped off after the first space
        Hide
        blackdrag blackdrag added a comment -

        fixed

        Show
        blackdrag blackdrag added a comment - fixed
        Hide
        Levi Yourchuck added a comment -

        appears to be broken in groovy 1.5.7

        C:_sources\src - xxxx yyyy>groovy -cp "C:_deployments\xxxx yyyy\temp_build" groovylink.groovy
        Caught: java.io.FileNotFoundException: C:_sources\src - xxxx yyyy\yyyy\temp_build groovylink.groovy (C:_sources\src - xxxx yyyy\yyyy\temp_build groovylink.groovy)

        notice that what I entered for the classpath has a space between the xxxx and the yyyy (the file not found message is mangling the path even more)

        Show
        Levi Yourchuck added a comment - appears to be broken in groovy 1.5.7 C:_sources\src - xxxx yyyy>groovy -cp "C:_deployments\xxxx yyyy\temp_build" groovylink.groovy Caught: java.io.FileNotFoundException: C:_sources\src - xxxx yyyy\yyyy\temp_build groovylink.groovy (C:_sources\src - xxxx yyyy\yyyy\temp_build groovylink.groovy) notice that what I entered for the classpath has a space between the xxxx and the yyyy (the file not found message is mangling the path even more)
        Hide
        blackdrag blackdrag added a comment -

        I suggest you open a new issue and request to backport the change.

        Show
        blackdrag blackdrag added a comment - I suggest you open a new issue and request to backport the change.

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Graeme Rocher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: