Paid for writing

In case you like my writing and would like me to write for your website, then please leave a comment to any of my blog article, mentioning your Email Id and I will reply back. Thanks

Wednesday, January 28, 2009

Display System Properties using Java

//SystemProp.java

public class SystemProp
{

public static void main(String[] args)
{
System.out.println("File Separator : " + System.getProperty("file.separator"));
System.out.println("Java Class Path :" + System.getProperty("java.class.path"));
System.out.println("Java Class Version :" + System.getProperty("java.class.version"));
System.out.println("Java Home :" + System.getProperty("java.home"));
System.out.println("Java Vendor :" + System.getProperty("java.vendor"));
System.out.println("Java Vendor URL :" + System.getProperty("java.vendor.url"));
System.out.println("Java Version :" + System.getProperty("java.version"));
System.out.println("Line Separator :" + System.getProperty("line.separator"));
System.out.println("OS Architecture :" + System.getProperty("os.arch"));
System.out.println("OS Name :" + System.getProperty("os.name"));
System.out.println("Path Separator :" + System.getProperty("path.separator"));
System.out.println("User Directory :" + System.getProperty("user.dir"));
System.out.println("User Home :" + System.getProperty("user.home"));
System.out.println("User Name :" + System.getProperty("user.name"));
}
}



/*
Output

File Separator : \
Java Class Path :.
Java Class Version :50.0
Java Home :C:\Program Files\Java\jdk1.6.0_10\jre
Java Vendor :Sun Microsystems Inc.
Java Vendor URL :http://java.sun.com/
Java Version :1.6.0_10-beta
Line Separator :

OS Architecture :x86
OS Name :Windows XP
Path Separator :;
User Directory :C:\Program Files\Java\jdk1.6.0_10\bin
User Home :C:\Documents and Settings\o085195
User Name :o085195

*/

0 comments: