sleep 2 seconds before waiting? I have no idea why Windows thinks it's exit 0

This commit is contained in:
idk
2022-08-21 20:01:34 -04:00
parent b1bfd39327
commit 629162372e
3 changed files with 23 additions and 4 deletions

View File

@ -415,6 +415,7 @@ public class I2PFirefox {
System.out.println(pb.command());
Process p = pb.start();
System.out.println("I2PFirefox");
sleep(2000);
try{
System.out.println("Waiting for I2PFirefox to close...");
int exit = p.waitFor();
@ -452,5 +453,14 @@ public class I2PFirefox {
System.out.println("I2PFirefox");
I2PFirefox i2pFirefox = new I2PFirefox();
i2pFirefox.launch(privateBrowsing);
}
}
private static void sleep(int millis) {
try {
Thread.sleep(millis);
} catch (InterruptedException bad) {
bad.printStackTrace();
throw new RuntimeException(bad);
}
}
}