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