码迷,mamicode.com
首页 > 编程语言 > 详细

获取Java系统相关信息

时间:2016-02-19 12:19:08      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

 1 package com.test;
 2 
 3 import java.util.Properties;
 4 import java.util.Map.Entry;
 5 
 6 import org.junit.Test;
 7 
 8 public class SystemTest {
 9 
10     /**
11      * 获取Java系统相关信息
12      * @throws Exception
13      */
14     @Test
15     public void testSys() throws Exception {
16         //System.out.println();
17         Properties properties = System.getProperties();
18         
19         for(Entry<Object, Object> entry : properties.entrySet()){
20             System.out.println(entry.getKey()+"===>"+entry.getValue());
21         }
22     }
23 }

 

获取Java系统相关信息

标签:

原文地址:http://www.cnblogs.com/sun-rain/p/5200367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!