Finding System Details in Java

Wanna display the OS name, home directory and version using Java? The code snippet given below does just that.

public class MainClass{
public static void main(String[] args){
System.out.println(System.getProperty ("user.dir"));
System.out.println(System.getProperty ("java.version"));
System.out.println(System.getProperty ("java.home"));
System.out.println(System.getProperty ("os.name"));
System.out.println(System.getProperty ("user.name"));

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

}
}

Have fun. 🙂

Advertisements

About Manikandan Surendren

A PeopleSoft Techno-functional Consultant. An engineering graduate in Computer Science. Technology Enthusiast. Movie freak. Gadget geek.
This entry was posted in Code. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s