List<String> commend = new ArrayList<String>();
commend.add("d:/dev/jdk1.8.0_131/bin/java");
commend.add("-jar");
commend.add("F:/src/xx-center/target/xx-center.jar");
try {
ProcessBuilder builder = new ProcessBuilder();
builder.command(commend);
Process process = builder.start();
InputStream in=process.getInputStream();
byte[] re=new byte[1024];
while (in.read(re)!= -1) {
System.out.println("==>"+new String(re));
}
in.close();
if(process.isAlive()){
process.waitFor();
}
} catch (Exception e) {
e.printStackTrace();
}