| Author |
unix commands thru java program
|
Bhasker Reddy
Ranch Hand
Joined: Jun 13, 2000
Posts: 176
|
|
can we issue unix commands thru java program. I am writing a java file, i have shell program. I need to issue those directives to the unix system thru java program can i do that. does anyone has any idea regarding this. if i am not clear enough please let me know thanks
|
Bhasker Reddy
|
 |
Kripal Singh
Ranch Hand
Joined: Jul 26, 2001
Posts: 254
|
|
you can execute your command using following code Runtime rt = Runtime.getRuntime(); try{ Process ps = rt.exec(your command here); } catch(Exception e) { System.out.print(e.getMessage()); }
|
# Help an unprivileged kid.<br /> Whatever u do will make a difference...<br /> ...to a child's life & ur own #<br /><a href="http://www.cry.org/" target="_blank" rel="nofollow">www.cry.org/</a>
|
 |
 |
|
|
subject: unix commands thru java program
|
|
|