Java API to obtain information about the operating system

Source: Internet
Author: User

 

Method: system. getproperty (propertyname );

 

Propertyname can be the following values:

 

Java. runtime. Name: name of the Java Runtime Environment

 

Bin directory of sun. boot. Library. Path JRE

 

Java. VM. Version Java Virtual Machine version

 

Java. VM. Vendor Java virtual machine vendor

 

Java. Vendor. url Java vendor URL

 

Path. Separator of environment variables in Java

 

Java. VM. Name Java VM name

 

User. Country the country code of the current user, such as CN.

 

User. dir main directory of the current program

 

Line. Separator line Separator

 

OS. Name: the operating system name, such as Windows XP.

 

Propertyname can be the following values:

 

User. home can be used to obtain the Home Directory of the current user.

Java
. Specification. Version: Get the current JDK version.

Java
. Class. Path get classpath

User. Name: Get the current user name

Java
. Home get JDK path

Sun. OS. Patch. Level: Get the system version number. It can also be said that the patch number is displayed as Service Pack 2.

OS. Arch: displays the OS type as x86.

OS. Version: displays the system internal version.

Java
. Io. tmpdir displays the temporary directory of the current system

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.