try {
java.lang.Process myproc = Runtime.getRuntime().exec("cmd.exe /c set PATH");
InputStream is = myproc.getInputStream();
byte[] data = new byte[1024*2];
int i = 0;
is.read(data,0,1024*2);
System.out.println(new String(data));
is.close();
is = null;
} catch (IOException e) {
e.printStackTrace();
}读取PATH,要读取CLASSPATH,则把PATH换成CLASSPATH
java.lang.Process myproc = Runtime.getRuntime().exec("cmd.exe /c set PATH");
InputStream is = myproc.getInputStream();
byte[] data = new byte[1024*2];
int i = 0;
is.read(data,0,1024*2);
System.out.println(new String(data));
is.close();
is = null;
} catch (IOException e) {
e.printStackTrace();
}读取PATH,要读取CLASSPATH,则把PATH换成CLASSPATH
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货