cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the system parameters

Former Member
0 Kudos

HI,

I want to know the performence of the system(Like physical memory details,RAM size,Processor,O/S name,O/S version,Total Disk space,Free space).So tell me the way of getting them.

Regards,

kiran.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can use this code for some of the things. For Memory related things you can use Runtime calls as already answered on a separate thread.

public class GetOpenProperties {

String[] propertyNames = {"file.separator",

"line.separator",

"path.separator",

"java.class.version",

"java.vendor",

"java.vendor.url",

"java.version",

"os.name",

"os.arch",

"os.version"};

final int numProperties = propertyNames.length;

public static void main(String args[]){

String value = null;

for (int i = 0; i < numProperties; i++) {

try {

value = System.getProperty(propertyNames<i>);

System.out.println(propertyNames<i>+ "=" + value);

} catch (Exception e) {

}

}

}

Regards,

ps: please do award points for useful answers.

Former Member
0 Kudos

HI

GOOD

GO LIKE THIS

START MENU->CONTROL PANEL->SYSTEM

THE SYSTEM SCREEN CONTAIN VARIOUS TABS AND YOU CAN SEE THE THE DETAILS RELATED TO THE SYSTEM.

THANKS

MRUTYUN

Former Member
0 Kudos

Hi,

I need to get them through my java program.So send me the related information and if possible send me the sample code.

Regards,

kiran

former_member192029
Active Contributor
0 Kudos

Hi Bhogi,

You can use Properties getProperties() and api doc is here

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()

Use Apache Java package freeSpace(String path)

Here you go the API link

http://jakarta.apache.org/commons/io/api-release/org/apache/commons/io/FileSystemUtils.html

Cheers

Jawahar Govindaraj

Ps: reward pts

Message was edited by: Jawahar Govindaraj