Try this hope this may be helpful..

import java.util.*;

public class Test{
        public static void main(String args[]){
                Properties props        =     System.getProperties();
                Enumeration enumSysProps        =     props.propertyNames();
                String keyName  =     "";
                while(enumSysProps.hasMoreElements()) {
                        keyName  = (String) enumSysProps.nextElement();
                        System.out.println("Key is " + keyName + " --> " + 
props.getProperty(keyName));
                }

                keyName =     System.getProperty("os.name");
                System.out.println(keyName);
        }
}

Rgds
Sitaram

-----Original Message-----
From: Campano, Troy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 7:44 PM
To: [EMAIL PROTECTED]
Subject: Java and System Commands


Is there a way that Java can get system information like Operating System name, 
Operating System version, amount of memory, etc?
I'm trying to do this so it's OS independent so it would work on  Windows, AIX, Sun, 
or Linux.

Basically something like RuntimeCommand("OS_NAME") could return "Windows NT" or 
"Linux".

Any ideas?


thanks!

troy campano

=========================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to