Galera,
Estou tentando reiniciar minha aplicação mas não estou conseguindo. Estou tentando da seguinte forma:
String dirInstalacao = new File("").getAbsolutePath();
String comando = "cmd.exe /C " + "\"" + dirInstalacao + "\\Start.exe" + "\"";
Process process = null;
try {
process = Runtime.getRuntime().exec(comando);
} catch (IOException e) {
e.printStackTrace();
}
try {
int sucess = process.waitFor();
if (sucess != 0) { // Falhou
System.out.println("Falha ao reiniciar: " + sucess);
}
} catch (InterruptedException e) {
System.out.println("Exceção ao reiniciar." + e.getMessage());
e.printStackTrace();
}