Process p = Runtime.getRuntime().exec(command);
is = p.getInputStream();
byte[] userbytes = new byte[1024];
is.read(userbytes);
I want to execute a shell command in linux os from java . But pmd reports says don't use java Runtime.exec(). Why? What is the reason ? Is there any alternative for Runtime.exec()?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…