I tried to use Runtime.getRuntime().exec(cmd) to run out jad app to decompile .class file. cmd = "../bin/jad Test.class" But I cannot get the output by this way:
Process p = Runtime.getRuntime().exec(jadCmd2);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
nothing output, can anyone tell?
I suspect you are getting an error. I suggest you print that out as well.
If you use ProcessBuilder you can combine the output and error so you only have one stream to read.
From http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html