On Windows, the command line length is restricted to 32Kb or somesuch.
FileSystemCompiler builds a command line that includes the classpath twice, which makes it prone to failure on Windows. See http://issues.gradle.org/browse/GRADLE-1420
The attatched patch reduces the problem by passing one of the classpath strings via the CLASSPATH environment variable instead of the -cp argument.
A further improvement would be to add @-handling to FileSystemCompiler's --classpath argument parser.