Chinaunix首页 | 论坛 | 博客
  • 博客访问: 29511296
  • 博文数量: 708
  • 博客积分: 12163
  • 博客等级: 上将
  • 技术积分: 8240
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-04 20:59
文章分类

全部博文(708)

分类: Java

2014-10-07 11:01:03

使用java.lang.System.setProperties(Properties props)一定要先java.lang.System.getProperties()

Sets the system properties to the Properties argument.

First, if there is a security manager, its checkPropertiesAccess method is called with no arguments. This may result in a security exception.

The argument becomes the current set of system properties for use by the method. If the argument is null, then the current set of system properties is forgotten.

setProperties参数Properties覆盖System原有的Properties。


Properties properties = System.getProperties();
properties.load(inputStream);
inputStream.close();
System.setProperties(properties);

阅读(3250) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~