Java Get System Information

Source: Internet
Author: User

public class SystemInfo {public static void main (string[] args) {//System attribute Properties prop = System.getproperties (); System.out.println (Prop.getproperty ("Os.name")); Operating system name Windows 7system.out.println (Prop.getproperty ("os.version")); Operating system version 6.1system.out.println (Prop.getproperty ("Os.arch")); Operating system Architecture Current X86SYSTEM.OUT.PRINTLN (Prop.getproperty ("java.version")); Java version 1.6.0_17system.out.println (Prop.getproperty ("Java.vendor")); JDK maker Sun Microsystems Inc.System.out.println (Prop.getproperty ("java.specification.version")); Java Runtime Environment version 1.6system.out.println (Prop.getproperty ("Java.specification.name")); Java Runtime Environment Java Platform API SpecificationSystem.out.println (Prop.getproperty ("java.vm.version")); Java Virtual machine version 14.3-b01system.out.println (Prop.getproperty ("Java.vm.name"));//Java Virtual machine Java HotSpot (TM) Client VMSystem.out.println (Prop.getproperty ("User.dir"));//user temp directory D:\workspace01\ssi System.out.println ( Runtime.getruntime (). MaxMemory ()/1024/1024 + ""); Max Memory 63msystem.out.println (Runtime. GetRuntime (). TotalMemory ()/1024/1024 + ""); Available Memory 4msystem.out.println (Runtime.getruntime (). Freememory ()/1024/1024 + ""); Remaining Memory 4M}}

Java Get System Information

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.