Thursday, May 25, 2006

System property

How to know the OS name on which my Java application is running?

System.out.println(System.getProperty("user.name" ));

How can I learn the various keys in System property?

Enumeration en = System.getProperties().propertyNames();

while(en.hasMoreElements()){
System.out.println("Result : " + en.nextElement());
}

0 Comments:

Post a Comment

<< Home