Vote count:
0
I have a command that works no problem when typed into the terminal although I would like to execute it from a java program.
I am using this code where "homedir" was found from typing in the terminal which spark.
String homedir = "/usr/local/bin/spark";
File wd = new File(homedir);
Process pwd = Runtime.getRuntime().exec("spark", null, wd);
When I run the code though I still get an error: Cannot run program "spark" (in directory "/usr/local/bin"): error=2, No such file or directory
What am I missing that is stopping this from working?
asked 36 secs ago
Java execute command in OSX
Aucun commentaire:
Enregistrer un commentaire