Ich möchte eine batch file starten und wenn sie erfolgreich beendet wurde, möchte ich ihr output bekommen. Ich weiß aber nicht wie.
Habe es mit ByteArrayOutputStream probiert, hat aber nicht funktioniert.
Habe es mit ByteArrayOutputStream probiert, hat aber nicht funktioniert.
Java:
Process p = Runtime.getRuntime().exec(path + "/gradlew.bat");
p.waitFor();
ByteArrayOutputStream out = (ByteArrayOutputStream) p.getOutputStream();
System.out.println(new String(out.toByteArray()));