Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML

Search:
   Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML Facing Programming Problem? Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
Operating System Information
In this example we are learn how we can get information about our operation system.
 
 

Operating System Information

                         

In this example we are learn how we can get information about our operation system. In this example we are getting the OS name, its version and architecture of OS. We are using getProperty(String key)  to get the property of the OS. To get OS name we have key value os.name,to get version we have os.version and to get architecture we have os.orch

The System class contains several useful class fields and methods. It cannot be instantiated. 

The method and its keys:

String getProperty(String key):
This method is used to get the system property. 

S/No. Key Description
1 java.version The version of Java Runtime Environment.
2 java.vendor  The name of Java Runtime Environment vendor
3 java.vendor.url The URL of Java vendor
4 java.home The directory of Java installation 
5 java.vm.specification.version The specification version of Java Virtual Machine
6 java.vm.specification.vendor The name of specification vendor of Java Virtual Machine 
7 java.vm.specification.name Java Virtual Machine specification name
8 java.vm.version  JVM implementation version
9 java.vm.vendor JVM implementation vendor
10 java.vm.name  JVM  implementation name
11 java.specification.version  The name of specification version Java Runtime Environment 
12 java.specification.vendor  JRE specification vendor
13 java.specification.name  JREspecification name
14 java.class.version Java class format version number
15 ava.class.path Path of java class
16 java.library.path List of paths to search when loading libraries
17 java.io.tmpdir The path of temp file
18 java.compiler The Name of JIT compiler to use
19 java.ext.dirs The path of extension directory or directories
20 os.name  The name of OS name
21 os.arch  The OS architecture
22 os.version  The version of OS
23 file.separator The File separator
24 path.separator  The path separator 
25 line.separator The line separator
26 user.name The name of account name user
27 user.home The home directory of user 
28 user.dir  The current working directory of the user

The code of the program is given below:

public class OpertingSystemInfo 
{
    public static void main(String[] args)
    {
        String nameOS = "os.name";        
        String versionOS = "os.version";        
        String architectureOS = "os.arch";
    System.out.println("\n    The information about OS");
        System.out.println("\nName of the OS: " 
System.getProperty
(nameOS));
        System.out.println("Version of the OS: " 
System.getProperty
(versionOS));
        System.out.println("Architecture of THe OS: " 
System.getProperty
(architectureOS));
    }
}

The output of the program is given below:

C:\convert\rajesh\completed>javac OpertingSystemInfo.java
C:\convert\rajesh\completed>java OpertingSystemInfo
    The information about OS
Name of the OS: Windows 2000
Version of the OS: 5.0
Architecture of The OS: x86

Download this example.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.