JavaSE---The Platform Environment
1、Configuration Utilities
This section describes some of the configuration utilities that help an application access its startup context.
1.1、Properties
Properties are configuration values managed as key/value pairs.
In each pair, the key and value are both String
values.
To manage properties, create instances of java.util.Properties
.
The System
class maintains a Properties
object that defines the configuration of the current working environment.
1.2、Command-Line Arguments
A Java application can accept any number of arguments from the command line.
This allows the user to specify configuration information when the application is launched.
1.3、Environment Variables
Many operating systems use environment variables to pass configuration information to applications.(许多操作系统 使用 环境变量 传递配置信息给应用)
Querying Environment Variables
On the Java platform, an application uses System.getenv
to retrieve environment variable values.
Environment variables are key/value pairs, where both the key and the value are strings.