Java - general

Finish reading system-properties with System.getProperty("..")

java.lang.System



Some of the existing systemproperties:

file.separatorThe fileseperator, also the separation mark between the elements of a pathname
java.class.versionThe version of the Java-class library
java.class.pathThe current path to the classes (classpath)
java.io.tmpdirThe temporary directory
java.vendoreditor of the Java-version
java.vendor.urlA link to edit
java.versionThe Java-version
line.separatorThe sign for line foldings
os.archoperating system architecture
os.nameThe name of the operating system
path.separatorseparators for the drive mechanism-statement in a pathname
user.dirThe current work directory of the user
user.homeThe home-directory of the user
user.languageThe language which is setted at the user
user.nameThe username


All properties can be handed out by the following Code:

import java.util.*;
 
public class ShowSystemProperties {
   public static void main(String[] args) {
      Properties props = System.getProperties();
      Enumeration names = props.propertyNames();
      while (names.hasMoreElements()) {
         String name = (String)names.nextElement();
         System.out.println(name + "=" + System.getProperty(name));
      }
   }
}



Key words:
temporary directory folder user system properties path version home user line-foldings file separator username language


Eigene Werkzeuge
Werkzeuge

gratis Counter by GOWEB
seit 9.10.2007