可以通过system.getProperites() 获得系统变量, 不能直接设置(可以通过jni 实现)
mac 的不知道

解决方案 »

  1.   

    MAC地址只能通过本地代码得到。
      

  2.   

    classpath:
    System.out.println(System.getProperty("java.class.path"));
      

  3.   

    http://expert.csdn.net/Expert/topic/2854/2854297.xml?temp=.6320307
      

  4.   

    java.util.Enumeration en = java.net.NetworkInterface.getNetworkInterfaces();
    java.util.Enumeration enA = null;
    java.net.NetworkInterface netIf = null;
    while (en.hasMoreElements()) {
    netIf = (java.net.NetworkInterface)en.nextElement();
    System.out.print(netIf.getName() + " : ");
    enA = netIf.getInetAddresses();
    while (enA.hasMoreElements()) {
    java.net.Inet4Address ip = (java.net.Inet4Address)enA.nextElement();
    System.out.println(ip.getHostAddress());
    }
    }
      

  5.   

    import java.net.InetAddress;
      import java.net.UnknownHostException;
      public class GetIP {
       static public void main(String[] args) {
       try {
      InetAddress address = InetAddress.getByName(args[0]);
      System.out.println(args[0]+"
      : "+address.getHostAddress());
       }
       catch(UnknownHostException uhe) {
      System.err.println("Unable to find: "+args[0]);
       }
       }
      }