Method:
private static void stopActiveMQ(String java, String mqPath) throws IOException {
File cwd = new File(mqPath);
ProcessBuilder pb = new ProcessBuilder(java, "-jar", "activemq.jar", "stop").inheritIO();
pb.directory(cwd);
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Calling the above Method:
stopActiveMQ("C:\Program Files\Java\jdk1.8.0_92\bin\java.exe", "E:\Softwares\apache-activemq-5.13.1\bin");
private static void stopActiveMQ(String java, String mqPath) throws IOException {
File cwd = new File(mqPath);
ProcessBuilder pb = new ProcessBuilder(java, "-jar", "activemq.jar", "stop").inheritIO();
pb.directory(cwd);
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Calling the above Method:
stopActiveMQ("C:\Program Files\Java\jdk1.8.0_92\bin\java.exe", "E:\Softwares\apache-activemq-5.13.1\bin");
No comments:
Post a Comment