Link to home
Start Free TrialLog in
Avatar of aaronmcl
aaronmcl

asked on

How to get system properties?

Can anyone show me how to do this?
I know how to display the java system properties and operating system name, version and the like, but is it possible to display cpu size, system memory, hdd size, etc.?

Regards
Aaron
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

/**
 *  Description of the Class
 *
 * @author     CEHJ
 * @created    30 March 2004
 */
public class Props {

        /**
         *  The main program for the Props class
         *
         * @param  args  The command line arguments
         */
        public static void main(String[] args) {
                if (args.length > 0) {
                        for (int i = 0; i < args.length; i++) {
                                System.out.println(System.getProperty(args[0]));
                        }
                }
                else {
                        System.getProperties().list(System.out);
                }
        }
}
Avatar of aaronmcl
aaronmcl

ASKER

Yeah, i know how to display those properties.
Is it possible to display cpu size, system memory, hdd size, etc.?
Not i don't think without JNI or some JNI wrapper
I didnt think so.
Thanks anyway CEHJ
OK
I answered the question..?
ASKER CERTIFIED SOLUTION
Avatar of PAQ_Man
PAQ_Man
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So i see my intervention was simply ignore by PAQ_Man