Hi, I have three programs, A.java, B.java and C.java I want to run them sequentially using .bat file,such that only when A.java does not throw an exception, I should execute B.java else I should execute C.java Could any one tell me how to write a DOS batch file for this. Thanks
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi, why don't you write a single main class, which starts your A.java B.java C.java if no exception is thrown ??? As far as i know there is no exit status in java like in C for example. So the solution above should be easy and effective.
Steve Chernyak
Ranch Hand
Joined: Oct 19, 2000
Posts: 113
posted
0
Oliver is right about executing all of the logic from java as a better solution. However, there ARE exit codes in java. If the exit code is not zero, that means the program failed to execute. The variable errorLevel should contain the exit code in the batch script.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.