I've been looking up ways to run external programs using Java's runtime. This works fine, for instance:
String[] cmd = {"mkdir", "test"};
Runtime.getRuntime().exec(cmd);
Creates a new directory as you would expect. Now, from a bash window in Mac I can write this:
love testgame
To run the 'Love' game engine on a folder called testgame. Now, the reason this works is because I've aliased 'love' to call the love executable. I have a feeling that this is the reason that the following does not work:
String[] cmd = {"love", "/Users/mtc06/testgame"};
Runtime.getRuntime().exec(cmd);
And nor does this (for those wondering):
String[] cmd = {"/bin/bash", "love", "/Users/mtc06/testgame"};
Runtime.getRuntime().exec(cmd);
No doubt this is either some Java idiocy on my part, or some clash with the way that aliasing works. I hand it over to your venerable intellects, SO!
UPDATE: this doesn't work either:
String[] cmd = {"/bin/sh", "/Applications/love", "/Users/michaelcook/Desktop/Playout"};
Runtime.getRuntime().exec(cmd);
The error I'm receiving is 127 from the process generated by Runtime. I'm getting that as 'command not found' wherever I research it.