question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors running commands on Windows

See original GitHub issue

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)
}

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
lordcodescommented, Jul 28, 2022

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.

1reaction
lordcodescommented, Dec 4, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found