private static void stopMongoDB() throws IOException {
ProcessBuilder pb = new ProcessBuilder("taskkill", "/IM", "mongod.exe").inheritIO();
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
calling the above method:
stopMongoDB();
ProcessBuilder pb = new ProcessBuilder("taskkill", "/IM", "mongod.exe").inheritIO();
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
calling the above method:
stopMongoDB();
No comments:
Post a Comment