案例一
hello.bat
CALL hello1.batCALL hello2.bat@echo.&pause
@echo.&pause 当前窗口换行且不退出。
运行时,会先等hello1.bat执行完毕,在执行hello2.bathello1.bat
java -jar hello1.jar
hello2.bat
java -jar hello2.jar
案例二
- hello.bat
@echo.&pause 当前窗口换行且不退出。java -jar hello1.jarjava -jar hello2.jar@echo.&pause
运行时,会先等第一行的java命令执行完毕,在执行第二行的java命令
附java测试代码:
public class Main {public static void main(String[] args) throws InterruptedException {System.out.println("1");Thread.sleep(10000);System.out.println("2");}}
public class Main {public static void main(String[] args) throws InterruptedException {System.out.println("3");}}
执行时总是先输出 1、2,最后在输出3
