Java - (Environment|Operating System)

> Procedural Languages > Java

1 - About

Most of the OS informations are managed in the System class.

Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method.

3 - Characteristics

3.1 - Memory

3.2 - Variable

  • All
Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {
	System.out.format("%s=%s%n", envName, env.get(envName));
}
  • One
String myEnv = System.getenv("myEnvname");
Advertising
lang/java/environment.txt · Last modified: 2017/02/12 21:06 by gerardnico