import  java.io.*;
import  java.util.*;
import  java.lang.System;public class TestSystem
{
public static void main(String[]args)throws Exception
{
Map<String,String> env=new System.getenv();
for(String name:env.keySet())
{
System.out.println(name+"--------->"+env.get(name));
}
System.out.println(System.getenv("java_HOME"));
Propertise props=System.getPropertise();
props.store(new FileOutputStream("b.txt"),"System Propertise");
System.out.println(System.getProperty("os.name"));
}
}
为什么调试会出现找不到符号?

解决方案 »

  1.   


    import java.io.*;
    import java.util.*;
    import java.lang.System;public class TestSystem
    {
    public static void main(String[]args)throws Exception
    {
    Map<String,String> env=System.getenv();
    for(String name:env.keySet())
    {
    System.out.println(name+"--------->"+env.get(name));
    }
    System.out.println(System.getenv("java_HOME"));
    Properties props=System.getProperties();
    props.store(new FileOutputStream("b.txt"),"System Propertise");
    System.out.println(System.getProperty("os.name"));
    }
    }
      

  2.   

    properties,System的静态方法不要加new。