So I want to communicate to my core in OSX. I can do this no problem with the spark-cli in the terminal and it will work no problem.
I have found how to execute commands in java with help from places like this.
Only problem is I keep getting an error:
java.io.IOException: Cannot run program "spark": error=2, No such file or directory
Is it possible to send the strings I want to run straight into the terminal from java?
When exec`ing shell commands from other languages, the key is making sure you’ve got all the environment variables set. Make sure your path includes the location of the CLI, and the Node.js environment variables, etc.
Process pwd = Runtime.getRuntime().exec("/usr/local/bin/spark", null, wd);
The “working directory” is not the same as the “search path” for commands.It’s probably best to specify the full path directly in your command parameter.