0

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

2
  • 1
    What have you already have? What is the exact problem? Commented 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 me Commented May 2, 2011 at 6:59

2 Answers 2

2
Runtime.getRuntime().exec("here_you_add_your_shell_commands");
Sign up to request clarification or add additional context in comments.

2 Comments

but it work only for one command and I want to pass next command also
You can execute it again with different arg. or create a shell script and invoke it.
2

Try:

ProcessBuilder prBuilder = new ProcessBuilder(your_script/command, arg1, arg2);
prBuilder = prBuilder.directory(your_working_dir);
Process p = prBuilder.start();

2 Comments

I can execute only ./LicenseGen.sh command but I want to execute one more command under ./LicenseGen.sh plz help me
Does LicenseGen.sh starts its own shell?(like license#)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.