获取Java系统相关信息

时间:2024-04-19 19:33:50
 package com.test;

 import java.util.Properties;
import java.util.Map.Entry; import org.junit.Test; public class SystemTest { /**
* 获取Java系统相关信息
* @throws Exception
*/
@Test
public void testSys() throws Exception {
//System.out.println();
Properties properties = System.getProperties(); for(Entry<Object, Object> entry : properties.entrySet()){
System.out.println(entry.getKey()+"===>"+entry.getValue());
}
}
}