JavaExec does not handle Spaces in Classpath

not-a-bug

(Joshua Street) #1

Gradle Version: 2.12, 2.14, 3.0
Operating System and JVM version: Windows 10 x64, JDK 8
Is this a regression? If yes, which version of Gradle do you know it last worked for? Not a regression

This is related to open bug GRADLE-1577.

Gradle does not account for items in the classpath of a JavaExec task that contain spaces in their paths. Thus, running the command fails in windows because it incorrectly interprets the end of the classpath at the first space encountered.

Possible fix would be to use the CollectionUtils.asCommandLine() to handle transforming this classpath into a safe commandline argument before outputting it as part of the list of all JVM args in JavaExecHandleBuilder


(Joshua Street) #2

I did some more digging into this and determined that what I was seeing was not because of spaces. I may have actually been defeating whatever is being done to sanitize process arguments that contain spaces by trying to include my own quotes.

The topic should be considered invalid.

As for GRADLE-1577, it may also be ok (its a really old bug report) and may be closable.