Errors running commands on Windows
See original GitHub issueError:
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)
}
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Errors when you run WinRM commands - Windows Client
This article provides a solution to errors that occur when you run WinRM commands to check local functionality in a Windows Server 2008 ......
Read more >Error Handling in a batch file - Windows CMD - SS64.com
How-to: Error Handling in a batch file. When an executable program runs and completes a task, it will return an Exit Code indicating...
Read more >MS-DOS and Windows Command Line Errors - Computer Hope
MS-DOS and Windows command line errors · A duplicate file name exists, or the file cannot be found. · Abort, Retry, Fail? ·...
Read more >Resolving problems when running commands - IBM
Solution: Download and install the Microsoft Visual C++ 2010 Redistributable Package. Backing up or restoring the integration node returns error ...
Read more >Error Running command in Windows PowerShell Modules
You can try adding the path to python.exe to your windows system variables.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub 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.