I need to run two lines in Runtime.getRuntime().exec(), this two:
cd %CMS_HOME%
ant deploy
Now is it possible to make a .bat file, but I think it is useless for two lines,
is muss be easier! Someone any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Put it in a
.batfile. It’s not useless; that’s just how Runtime.exec works.You should look into using the ProcessBuilder class instead of
Runtime.exec(). It was introduced in JDK 5 as the successor toRuntime.exec().