I have a Java standalone gui developed using eclipse Java EE.
Firstly I need to run a C executable with the command line similar to (it varies based on user input) this:
String filePath = "nohup C:/Users/User/workspacejavatest2/t3drive.exe -v4 fred777 1 1 1 java2.msg > fred777.log 2>&1 &"; Process p = Runtime.getRuntime().exec(filePath);
First question is how best to ensure this is correctly escaped. Is there a uri type approach or is it a manual job?
Secondly I'd like to kill the process if something goes wrong. What is the best approach when this might be used on Linux, Windows, or whatever?
Just looking for guidance, not code, as don't want to do it the longway round if there is a slick approach. Many thanks for viewing and even more tx for any ideas