C
cerberus
Gast
wie benutze ich environment variables in java version 1.4!?
Deprecated. The preferred way to extract system-dependent information is the system properties of the java.lang.System.getProperty methods and the corresponding getTypeName methods of the Boolean, Integer, and Long primitive types. For example:
String classPath = System.getProperty("java.class.path",".");
#java -Dkey=value <prog>
Process p =Runtime.getRuntime().exec("env"); // linux
//Process p =Runtime.getRuntime().exec("set"); // windows
BufferedReader br = new BufferedReader( new InputStreamReader( p.getInputStream() ) );
String buffer = null;
while ((buffer = br.readLine()) != null)
{
System.out.println( buffer );
}