je veux que programme affiche la liste des processus avec leurs répertoires, mais ca marche pas ,qui peut m'aider?
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.*;
import java.lang.*;
public class ListProc{
public static void main(String[] args) {
String strOutput = "";
String strError = "";
File rep=null;
File dir=null;
try {
String [] command=new String[] {"tasklist"};
String [] envp=new String[] {};
Process p = Runtime.getRuntime().exec(command,envp, dir );
rep=dir;
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
while (strOutput != null) {
if (strOutput.length() < 1) {
} else {
System.out.println(strOutput);
}
strOutput = stdInput.readLine();
}
}
strError = stdError.readLine();
if (strError != null) {
System.out.println("An error occured");
while (strError != null) {
System.out.println(strError);
strError = stdError.readLine();
}
}
} catch (IOException ioe) {
System.out.println("An IOException occured");
ioe.printStackTrace();
System.exit(-1);
}
catch (SecurityException s){
System.out.println(s);}
}
}