Skip to content

Commit 0dc7623

Browse files
committed
Use ProcessBuilder instead of Runtime.exec
1 parent ae2dcd5 commit 0dc7623

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/src/main/kotlin/org/javacs/kt/classpath/ShellClassPathResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal class ShellClassPathResolver(
1717
val workingDirectory = workingDir?.toFile() ?: script.toAbsolutePath().parent.toFile()
1818
val cmd = script.toString()
1919
LOG.info("Run {} in {}", cmd, workingDirectory)
20-
val process = Runtime.getRuntime().exec(cmd, null, workingDirectory)
20+
val process = ProcessBuilder(cmd).directory(workingDirectory).start()
2121

2222
return process.inputStream.bufferedReader().readText()
2323
.split(File.pathSeparator)

0 commit comments

Comments
 (0)