My goal is pretty simple: I wan't to execute a shell command (e.g. "pwd") from java code that is on Google Cloud Platform (App Engine in my case). Locally i'm capable of doing so either by a ProcessBuilder or Runtime.getRuntime().exec(...). The thing is that when I'm trying to deploy a Java service on GCP that needs to do that, it fails with the error: java.io.IOException: Cannot run program "pwd": error=2, No such file or directory
I tried working this out with: Runtime.getRuntime().exec(new String[]{"bash", "-l", "-c", "pwd"}, null); Which also works locally, but on GCP it still fails. Anyone?