web/scripts dir has a build.xml and command '
ant -Dname=xxx register' executes properly from Linux command prompt. I am trying to execute the same from my
java code. Following is the code snippet for the quick reference. And it throws exception saying 'ant' not found.
File wd = new File("/web/scripts");
Process proc = null;
try {
proc = Runtime.getRuntime().exec("ant -Dname=xxx register", null, wd);
} catch (Exception e) {
}
I even tried passing command as
String[] cmd = {"ant", "-Dname=xxx", "register"} but no use.
I have even tried using absolute path for the ant command "/urs/local/apache-ant-1.7.0/ant......" but no use.
Do you any of you guys know how to handle this? please help me out. thanks
webapp is in /web/tomcat/base/current/webapps
ant is installed in /urs/local/apache-ant-1.7.0... $ANT_HOME points to this director.
build.xml is in /web/scripts