runtime.exec - how to invoke sh file in linux terminal using Runtime.getRuntime().exec in java -


how invoke sh file in linux terminal using runtime.getruntime().exec in java ?

i want invoke sh file in new terminal java code. if run in terminal runs separate process, not closed if programs exits. , thats why i'm not using processbuilder, stops process invoked if program using exits.

if script marked executable (chmod +x script.sh), can invoke exec("./script.sh"). otherwise can directly call using exec("sh script.sh").


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -