I am developing a license Generation tool in java.I required to call a shell script from my java program which is license generation tool and after that I have to send command to license generation tool which takes a xml as a input but I am unable to do it please help me
-
1What have you already have? What is the exact problem?Vladimir Ivanov– Vladimir Ivanov2011-04-29 11:15:21 +00:00Commented Apr 29, 2011 at 11:15
-
I can execute only ./LicenseGen.sh command but I want to execute one more command under ./LicenseGen.sh plz help meNilesh Shukla– Nilesh Shukla2011-05-02 06:59:31 +00:00Commented May 2, 2011 at 6:59
Add a comment
|
2 Answers
Runtime.getRuntime().exec("here_you_add_your_shell_commands");
2 Comments
Nilesh Shukla
but it work only for one command and I want to pass next command also
Jigar Joshi
You can execute it again with different arg. or create a shell script and invoke it.
Try:
ProcessBuilder prBuilder = new ProcessBuilder(your_script/command, arg1, arg2);
prBuilder = prBuilder.directory(your_working_dir);
Process p = prBuilder.start();
2 Comments
Nilesh Shukla
I can execute only ./LicenseGen.sh command but I want to execute one more command under ./LicenseGen.sh plz help me
Nikunj
Does LicenseGen.sh starts its own shell?(like
license#)