turtle: Errors running commands on Windows

Error:

Exception in thread "main" com.lordcodes.turtle.ShellFailedException: Running shell command failed
	at com.lordcodes.turtle.ShellScript.runCommand(ShellScript.kt:87)
	at com.lordcodes.turtle.ShellScript.command(ShellScript.kt:48)
	at com.lordcodes.turtle.ShellScript.command$default(ShellScript.kt:44)
	at MainKt$main$output$1.invoke(Main.kt:6)
	at MainKt$main$output$1.invoke(Main.kt:5)
	at com.lordcodes.turtle.ShellKt.shellRun(Shell.kt:20)
	at com.lordcodes.turtle.ShellKt.shellRun$default(Shell.kt:19)
	at MainKt.main(Main.kt:5)
	at MainKt.main(Main.kt)
Caused by: java.io.IOException: Cannot run program "echo 'Hello, World!'": 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 com.lordcodes.turtle.ShellScript.runCommand(ShellScript.kt:82)
	... 8 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)
	... 10 more

I tried running a simple code, is there anything I’m doing wrong here?

import com.lordcodes.turtle.shellRun

fun main() {
    val output = shellRun {
        command("echo 'Hello, World!'")
    }
    println(output)
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Turtle is for launching external processes. Shell commands are commands you are running in your shell.

For example if you run “git”, it is running the Git program on your system via the shell.

The Turtle code itself runs on the JVM, not the commands you execute, they are system dependent. That is the purpose of using a tool to run shell commands.

I hope that makes things clear, closing the issue.

Thank you for even more information. You’ve been a great help. I will say specifically that some commands were written with MacOS in mind and so may not work as expected on Windows.

Thank you for letting me know. I’m unlikely to get time to update it for Windows unfortunately. I don’t use Windows at all. I will add a note to the README that makes it clear the library has been developed for MacOS and Linux/Windows are untested so may or may not work, i.e they aren’t officially supported.

Okay thanks. Sounds like maybe Windows doesn’t work for some reason.

I have reopened and made it clear in the title that there are issues running on Windows.

I don’t develop on Windows so I’m unlikely to get to this any time soon. My worry would be it could just break again without CI running on windows. I am inclined to say in the README that only Mac and Linux are officially supported for now. Realistically I only use it on Mac, but I do have CI running on Linux.