Possible Duplicate:
run shell command from java
I want to export some variable so I have this command.
Runtime.getRuntime().exec("export a=b");
what is wrong with this command because this throw exeption:
java.io.IOException: Cannot run program “export”: java.io.IOException: error=2, No such file or directory
export is a shell command, not a program.The best way to do this would be to encapsulate all of the shell logic into a single shell script and then execute “/bin/sh /path/to/file.sh”