
正文
Java可读取操作系统的配置
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
/**
* Java获取操作系统的配置环境
* @throws Exception
*/
@Test
public void testPro() throws Exception {
Properties properties = System.getProperties();
for(Entry<Object, Object> entry:properties.entrySet()){
System.out.println(entry.getKey()+"============="+entry.getValue());
} //获取从根目录到项目名的路径
String path = System.getProperty("user.dir");
System.out.println(path);
}






