I am trying to pass the compile configuration file collection as the classpath to a javaexec task that I have running. I have spaces in the file paths of some of the directories. I keep seeing failures when trying to execute my java executable because it cannot find class ‘Files’. This is 100% because there are no quotes around my classpath.
I ultimately have a command similar to:
java -cp C:\Program Files (x86)\foo.jar com.foo.MainClass You can see that the java command is interpreting
Files as my class because there are no quotes around the classpath argument.
I am on windows, developing a plugin in Java. I set my classpath by using the
JavaExecSpec.setClassPath(FileCollection) method. Is this a bug? I can’t seem to find a way to make sure the classpath is properly set for the command.