Hi,
I am tried creating an automatic build process using a
java scheduler which triggers the automatic build process at regular interval.
The java code--->
timer.schedule(new TimerTask() {
public void run() {
try {File dir = new File("D:\\");
Runtime.getRuntime().exec("D:\\build.bat", null, dir);
} catch (Exception e) {
e.printStackTrace();
}}}, delay, 60000);
I am trying to invoke a batch file "build.bat" using java code.The code invoke the build file at regularly aand it is on a infinite loop.
The build.bat file contains---->
del D:\Brajesh\ApplicationContextExample\jar\ApplicationContextExample.jar
cd D:\Brajesh\ApplicationContextExample
ant -buildfile build.xml
Now the problem is that the build file is creating a jar file which is not created till the java code execution is stopped.
I tried no of ways like -->
:loop
if not exist D:\Brajesh\ApplicationContextExample\jar\ApplicationContextExample.jar goto loop in batch file AND
do{ }while(!file1.exists()); in java code BUT nothing is working.
Please help with any suggestion solution.
Thanks in advance.