System.getProperties().list(System.out); 
http://www.chinajavaworld.net/doc/lang/37.html

解决方案 »

  1.   

    // Get all system properties
        Properties props = System.getProperties();
        
        // Enumerate all system properties
        Enumeration enum = props.propertyNames();
        for (; enum.hasMoreElements(); ) {
            // Get property name
            String propName = (String)enum.nextElement();
        
            // Get property value
            String propValue = (String)props.get(propName);
        }
      

  2.   

    取不到啊。
    设置一下windows环境变量,然后你试下面的代码:
    import java.util.Properties;
    public class getSystemProperties
    {
    public static void main(String args[])
    {
    Properties prop = new Properties(System.getProperties() );
    // prop.list(System.out);
    System.out.println(System.getProperty("TOMCAT_HOME"));
    }
    }
      

  3.   

    System.getProperties();
    没试过,也许可以!
      

  4.   

    // Get all system properties
        Properties props = System.getProperties();
        
        // Enumerate all system properties
        Enumeration enum = props.propertyNames();
        for (; enum.hasMoreElements(); ) {
            // Get property name
            String propName = (String)enum.nextElement();
        
            // Get property value
            String propValue = (String)props.get(propName);
        应该可以
      

  5.   

    no ,  Please test my post code,  you will find it return NULL.please test!!
      

  6.   

    不能获得,也没有这样的函数,不过要想实现也可以,运行程序时用参数java -D TOMCAT_HOME=%TOMCAT_HOME%
      

  7.   

    o,Ok, I am known,thanks.
      

  8.   

    用C实现吧,然后再java中调用。
    ^_^