Move classpath to a system variable so it can overcome command limits on Windows, while keep working fine on other system.

This commit is contained in:
Maksymilian Pawlak 2018-02-27 10:17:21 +00:00
parent 64d3f58202
commit 30e2c7deae

View File

@ -44,13 +44,12 @@ object ProcessUtilities {
if (maximumHeapSize != null) add("-Xmx$maximumHeapSize") if (maximumHeapSize != null) add("-Xmx$maximumHeapSize")
add("-XX:+UseG1GC") add("-XX:+UseG1GC")
addAll(extraJvmArguments) addAll(extraJvmArguments)
add("-cp")
add(classpath)
add(className) add(className)
addAll(arguments) addAll(arguments)
} }
return ProcessBuilder(command).apply { return ProcessBuilder(command).apply {
inheritIO() inheritIO()
environment().put("CLASSPATH", classpath)
if (workingDirectory != null) { if (workingDirectory != null) {
redirectError((workingDirectory / "$className.stderr.log").toFile()) redirectError((workingDirectory / "$className.stderr.log").toFile())
redirectOutput((workingDirectory / "$className.stdout.log").toFile()) redirectOutput((workingDirectory / "$className.stdout.log").toFile())