So I have a folder that has manu jar files. And I have to use these jar files in classpath for java exec task. But it gives me -
What went wrong:
Execution failed for task ‘:TestProj:runTest’.
A problem occurred starting process 'command ‘C:\Program Files\Java\jdk1.6.0_31\bin
java.exe’'
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is
too long
Try running your build with the --info argument to see what the actual command Gradle is attempting to run is. Also, you can simplify this a bit to include only .jar files.
You may want to consider whether all those JARs are necessary. You’re running to the command line length limit on Windows. If you do some Googling there are all kinds of hacky workarounds for this. Another alternative is always to use an operating system other than Windows
I’ve cobbled together some code from various places to implement Luke’s suggestion of creating a manifest jar. I’ve used it for the BootRunTask that’s shipped with the Spring Boot plugin but it should be the same for JavaExec as BootRunTask extends it.