You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if I'm doing something wrong here, but I got this error on a simple kotlin project.
Exception in thread "main" com.jaredrummler.ktsh.Shell$NotFoundException: Error opening shell: 'sh'
at com.jaredrummler.ktsh.Shell.<init>(Shell.kt:95)
at com.jaredrummler.ktsh.Shell.<init>(Shell.kt:52)
at com.jaredrummler.ktsh.Shell$Companion.get(Shell.kt:761)
at com.jaredrummler.ktsh.Shell$Companion.getSH(Shell.kt:766)
at MainKt.main(Main.kt:4)
at MainKt.main(Main.kt)
Caused by: java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
at java.base/java.lang.Runtime.exec(Runtime.java:615)
at java.base/java.lang.Runtime.exec(Runtime.java:439)
at java.base/java.lang.Runtime.exec(Runtime.java:370)
at com.jaredrummler.ktsh.Shell$Companion.runWithEnv(Shell.kt:784)
at com.jaredrummler.ktsh.Shell$Companion.access$runWithEnv(Shell.kt:746)
at com.jaredrummler.ktsh.Shell.<init>(Shell.kt:90)
... 5 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:494)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:159)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
... 12 more
Process finished with exit code 1
import com.jaredrummler.ktsh.Shell
fun main() {
val shell = Shell.SH // create a shell
val result = shell.run("echo 'Hello, World!'") // execute a command
if (result.isSuccess) { // check if the exit-code was 0
println(result.stdout()) // prints "Hello, World!"
}
}
The text was updated successfully, but these errors were encountered:
Cyberavater
changed the title
Exception in thread "main" com.jaredrummler.ktsh.Shell$NotFoundException
Exception in thread "main" com.jaredrummler.ktsh.Shell$NotFoundException on Windows
Aug 14, 2022
I'm not sure if I'm doing something wrong here, but I got this error on a simple kotlin project.
The text was updated successfully, but these errors were encountered: