﻿{"id":181,"date":"2014-02-18T10:59:11","date_gmt":"2014-02-18T02:59:11","guid":{"rendered":"http:\/\/blog.sway.com.cn\/?p=181"},"modified":"2014-02-18T10:59:11","modified_gmt":"2014-02-18T02:59:11","slug":"java%e8%be%93%e5%87%bajvm%e5%92%8c%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f%e7%9a%84%e7%9b%b8%e5%85%b3%e5%b1%9e%e6%80%a7","status":"publish","type":"post","link":"http:\/\/blog.sway.com.cn\/?p=181","title":{"rendered":"Java\u8f93\u51faJVM\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u76f8\u5173\u5c5e\u6027"},"content":{"rendered":"<p>\u65b9\u6cd5\u5c31\u662f\u5229\u7528Java\u63d0\u4f9b\u7684util\u5305\u4e2d\u7684Properties\u7c7b\uff1a<\/p>\n<pre class=\"lang:java decode:true \">import java.util.*;  \r\n\r\npublic class YourJavaProperties {  \r\n    public static void main(String args[]){  \r\n        Properties props=System.getProperties();   \r\n\r\n        System.out.println(\"Java\u7684\u8fd0\u884c\u73af\u5883\u7248\u672c\uff1a\"+props.getProperty(\"java.version\"));  \r\n        System.out.println(\"Java\u7684\u8fd0\u884c\u73af\u5883\u4f9b\u5e94\u5546\uff1a\"+props.getProperty(\"java.vendor\"));  \r\n        System.out.println(\"Java\u4f9b\u5e94\u5546\u7684URL\uff1a\"+props.getProperty(\"java.vendor.url\"));  \r\n        System.out.println(\"Java\u7684\u5b89\u88c5\u8def\u5f84\uff1a\"+props.getProperty(\"java.home\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u89c4\u8303\u7248\u672c\uff1a\"+props.getProperty(\"java.vm.specification.version\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u89c4\u8303\u4f9b\u5e94\u5546\uff1a\"+props.getProperty(\"java.vm.specification.vendor\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u89c4\u8303\u540d\u79f0\uff1a\"+props.getProperty(\"java.vm.specification.name\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u5b9e\u73b0\u7248\u672c\uff1a\"+props.getProperty(\"java.vm.version\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u5b9e\u73b0\u4f9b\u5e94\u5546\uff1a\"+props.getProperty(\"java.vm.vendor\"));  \r\n        System.out.println(\"Java\u7684\u865a\u62df\u673a\u5b9e\u73b0\u540d\u79f0\uff1a\"+props.getProperty(\"java.vm.name\"));  \r\n        System.out.println(\"Java\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u7248\u672c\uff1a\"+props.getProperty(\"java.specification.version\"));  \r\n        System.out.println(\"Java\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u4f9b\u5e94\u5546\uff1a\"+props.getProperty(\"java.specification.vender\"));  \r\n        System.out.println(\"Java\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u540d\u79f0\uff1a\"+props.getProperty(\"java.specification.name\"));  \r\n        System.out.println(\"Java\u7684\u7c7b\u683c\u5f0f\u7248\u672c\u53f7\uff1a\"+props.getProperty(\"java.class.version\"));  \r\n        System.out.println(\"Java\u7684\u7c7b\u8def\u5f84\uff1a\"+props.getProperty(\"java.class.path\"));  \r\n        System.out.println(\"\u52a0\u8f7d\u5e93\u65f6\u641c\u7d22\u7684\u8def\u5f84\u5217\u8868\uff1a\"+props.getProperty(\"java.library.path\"));  \r\n        System.out.println(\"\u9ed8\u8ba4\u7684\u4e34\u65f6\u6587\u4ef6\u8def\u5f84\uff1a\"+props.getProperty(\"java.io.tmpdir\"));  \r\n        System.out.println(\"\u4e00\u4e2a\u6216\u591a\u4e2a\u6269\u5c55\u76ee\u5f55\u7684\u8def\u5f84\uff1a\"+props.getProperty(\"java.ext.dirs\"));  \r\n        System.out.println(\"\u64cd\u4f5c\u7cfb\u7edf\u7684\u540d\u79f0\uff1a\"+props.getProperty(\"os.name\"));  \r\n        System.out.println(\"\u64cd\u4f5c\u7cfb\u7edf\u7684\u6784\u67b6\uff1a\"+props.getProperty(\"os.arch\"));  \r\n        System.out.println(\"\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff1a\"+props.getProperty(\"os.version\"));  \r\n        System.out.println(\"\u6587\u4ef6\u5206\u9694\u7b26\uff1a\"+props.getProperty(\"file.separator\"));   \/\/\u5728 unix \u7cfb\u7edf\u4e2d\u662f\uff02\uff0f\uff02  \r\n        System.out.println(\"\u8def\u5f84\u5206\u9694\u7b26\uff1a\"+props.getProperty(\"path.separator\"));   \/\/\u5728 unix \u7cfb\u7edf\u4e2d\u662f\uff02:\uff02  \r\n        System.out.println(\"\u884c\u5206\u9694\u7b26\uff1a\"+props.getProperty(\"line.separator\"));   \/\/\u5728 unix \u7cfb\u7edf\u4e2d\u662f\uff02\/n\uff02  \r\n        System.out.println(\"\u7528\u6237\u7684\u8d26\u6237\u540d\u79f0\uff1a\"+props.getProperty(\"user.name\"));  \r\n        System.out.println(\"\u7528\u6237\u7684\u4e3b\u76ee\u5f55\uff1a\"+props.getProperty(\"user.home\"));  \r\n        System.out.println(\"\u7528\u6237\u7684\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\uff1a\"+props.getProperty(\"user.dir\"));  \r\n    }  \r\n}<\/pre>\n<p>\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<pre class=\"lang:sh decode:true \">Java\u7684\u8fd0\u884c\u73af\u5883\u7248\u672c\uff1a1.6.0_15  \r\nJava\u7684\u8fd0\u884c\u73af\u5883\u4f9b\u5e94\u5546\uff1aSun Microsystems Inc.  \r\nJava\u4f9b\u5e94\u5546\u7684URL\uff1ahttp:\/\/java.sun.com\/  \r\nJava\u7684\u5b89\u88c5\u8def\u5f84\uff1aC:\/Java\/jre6  \r\nJava\u7684\u865a\u62df\u673a\u89c4\u8303\u7248\u672c\uff1a1.0  \r\nJava\u7684\u865a\u62df\u673a\u89c4\u8303\u4f9b\u5e94\u5546\uff1aSun Microsystems Inc.  \r\nJava\u7684\u865a\u62df\u673a\u89c4\u8303\u540d\u79f0\uff1aJava Virtual Machine Specification  \r\nJava\u7684\u865a\u62df\u673a\u5b9e\u73b0\u7248\u672c\uff1a14.1-b02  \r\nJava\u7684\u865a\u62df\u673a\u5b9e\u73b0\u4f9b\u5e94\u5546\uff1aSun Microsystems Inc.  \r\nJava\u7684\u865a\u62df\u673a\u5b9e\u73b0\u540d\u79f0\uff1aJava HotSpot(TM) Client VM  \r\nJava\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u7248\u672c\uff1a1.6  \r\nJava\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u4f9b\u5e94\u5546\uff1anull  \r\nJava\u8fd0\u884c\u65f6\u73af\u5883\u89c4\u8303\u540d\u79f0\uff1aJava Platform API Specification  \r\nJava\u7684\u7c7b\u683c\u5f0f\u7248\u672c\u53f7\uff1a50.0  \r\nJava\u7684\u7c7b\u8def\u5f84\uff1aC:\/Java-Justin\/DS;D:\/Program Files\/Eclipse\/plugins\/cpdetector\/cpdetector.jar  \r\n\u52a0\u8f7d\u5e93\u65f6\u641c\u7d22\u7684\u8def\u5f84\u5217\u8868\uff1aC:\/Java\/jre6\/bin;.;C:\/WINDOWS\/Sun\/Java\/bin;C:\/WINDOWS\/system32;C:\/WINDOWS;C:\/Java\/jre6\/bin\/client;C:\/Java\/jre6\/bin;C:\/WINDOWS\/system32;C:\/WINDOWS;C:\/WINDOWS\/System32\/Wbem;C:\/Program Files\/ATI Technologies\/ATI.ACE\/Core-Static;D:\/Program Files\/Borland\/SilkTest\/  \r\n\u9ed8\u8ba4\u7684\u4e34\u65f6\u6587\u4ef6\u8def\u5f84\uff1aC:\/DOCUME~1\/JUSTIN~1\/LOCALS~1\/Temp\/  \r\n\u4e00\u4e2a\u6216\u591a\u4e2a\u6269\u5c55\u76ee\u5f55\u7684\u8def\u5f84\uff1aC:\/Java\/jre6\/lib\/ext;C:\/WINDOWS\/Sun\/Java\/lib\/ext  \r\n\u64cd\u4f5c\u7cfb\u7edf\u7684\u540d\u79f0\uff1aWindows XP  \r\n\u64cd\u4f5c\u7cfb\u7edf\u7684\u6784\u67b6\uff1ax86  \r\n\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff1a5.1  \r\n\u6587\u4ef6\u5206\u9694\u7b26\uff1a\/  \r\n\u8def\u5f84\u5206\u9694\u7b26\uff1a;  \r\n\u884c\u5206\u9694\u7b26\uff1a  \r\n\r\n\u7528\u6237\u7684\u8d26\u6237\u540d\u79f0\uff1aJustin &amp; Avril  \r\n\u7528\u6237\u7684\u4e3b\u76ee\u5f55\uff1aC:\/Documents and Settings\/Justin &amp; Avril  \r\n\u7528\u6237\u7684\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\uff1aC:\/Java-Justin\/DS<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd5\u5c31\u662f\u5229\u7528Java\u63d0\u4f9b\u7684util\u5305\u4e2d\u7684Properties\u7c7b\uff1a import java.util.*; pu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":2,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":183,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/183"}],"wp:attachment":[{"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.sway.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}