import java.io.*;
class Sysexecute
{
public static void main(String args[]) throws IOException,InterruptedException,IllegalThreadStateException
{
Runtime rt= Runtime.getRuntime();
Process p=rt.exec("ls");
System.out.println(p.exitValue());
}
}
stavo imparando come eseguire i comandi di sistema in java e si è verificato questo errore. Ho provato a usare i lanci per negarlo ma non serviva. spiegare il motivo e la soluzioneGestione di IllegalThreadStateException
actual error:-
Exception in thread "main" java.lang.IllegalThreadStateException: process hasn't exited
at java.lang.UNIXProcess.exitValue(UNIXProcess.java:270)
at Sysexecute.main(Sysexecute.java:8)