Fork me on GitHub

I’m struggling with a build.clj task on Windows. I’m using build/process to start GraalVM’s native-image . It works fine on MacOS and Linux, but on Windows I get:

Execution error (IOException) at java.lang.ProcessImpl/create (
CreateProcess error=2, The system cannot find the file specified
I’m not familiar with this error. Does this mean that build/process was unable to find native-image? If so, is there the concept of $PATH on Windows and how does construct a PATH?


@U56R03VNW On Windows this is called native-image.cmd. If you use then it will work automatically without having to change the command name per OS.


(apply process/shell "native-image" ... args)


Thanks for the tip! I will try it and see if that solves the problem


You can also use babashka.fs/which which will search the path for the "executable" and it will return native-image.cmd on Windows. This function is used within babashka.process to solve this problem


fs also has a windows? function you can use to differentiate


Using fs/which fixed the problem! Thanks! Now I just have to cleanup all the different debugging statements and outputs I littered all over the script 🧹

🎉 2