home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / javafile / ch11 / ReadProperties.java < prev    next >
Encoding:
Java Source  |  1998-12-14  |  715 b   |  29 lines

  1.  
  2. import java.lang.*;
  3.  
  4. class ReadProperties {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         String str;
  9.  
  10.         try {
  11.  
  12.             str = System.getProperty("os.name", "not specified");
  13. System.out.println("  OS name: " + str);
  14.  
  15.             str = System.getProperty("java.version", "not specified");
  16. System.out.println("  JVM Version: " + str);
  17.  
  18.             str = System.getProperty("user.home", "not specified");
  19. System.out.println("  user.home: " + str);
  20.  
  21.             str = System.getProperty("java.home", "not specified");
  22. System.out.println("  java.home: " + str);
  23.  
  24.         } catch (Exception e) {
  25.             System.err.println("Caught exception " + e.toString());
  26. }
  27.     }
  28. }
  29.