private static void startMongoDB() throws IOException {
ProcessBuilder pb = new ProcessBuilder("C:\Program Files\MongoDB\Server\3.6\bin", "mongod.exe").inheritIO();
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
calling the Above Method:
startMongoDB();
ProcessBuilder pb = new ProcessBuilder("C:\Program Files\MongoDB\Server\3.6\bin", "mongod.exe").inheritIO();
Process proc = pb.start();
try {
proc.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
calling the Above Method:
startMongoDB();
No comments:
Post a Comment