View Javadoc

1   // System.java, created Fri Aug 16 18:11:48 2002 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.ClassLib.sun15_linux.java.lang;
5   
6   import joeq.Class.PrimordialClassLoader;
7   
8   /***
9    * System
10   *
11   * @author  John Whaley <jwhaley@alum.mit.edu>
12   * @version $Id: System.java 1479 2004-03-11 04:14:44Z jwhaley $
13   */
14  public abstract class System {
15      
16      private static java.util.Properties props;
17  
18      public static long nanoTime() {
19          // TODO.
20          return java.lang.System.currentTimeMillis() * 1000000L;
21      }
22      
23      private static java.util.Properties initProperties(java.util.Properties props) {
24          // TODO: read these properties from environment.
25          props.setProperty("java.class.version", "49.0");
26          props.setProperty("java.home", "/usr/java/j2sdk1.5.0/jre");
27          props.setProperty("java.runtime.name", "Java(TM) 2 Runtime Environment, Standard Edition");
28          props.setProperty("java.runtime.version", "1.5.0");
29          props.setProperty("java.specification.name", "Java Platform API Specification");
30          props.setProperty("java.specification.vendor", "Sun Microsystems, Inc.");
31          props.setProperty("java.specification.version", "1.5");
32          props.setProperty("java.vendor", "joeq");
33          props.setProperty("java.vendor.url", "http://joeq.sourceforge.net");
34          props.setProperty("java.vendor.url.bug", "http://joeq.sourceforge.net");
35          props.setProperty("java.version", "1.5.0");
36          props.setProperty("java.vm.name", "joeq virtual machine");
37          props.setProperty("java.vm.specification.name", "Java Virtual Machine Specification");
38          props.setProperty("java.vm.specification.vendor", "Sun Microsystems, Inc.");
39          props.setProperty("java.vm.specification.version", "1.0");
40          props.setProperty("java.vm.vendor", "joeq");
41          props.setProperty("java.vm.version", "1.5.0");
42          props.setProperty("java.util.prefs.PreferencesFactory", "java.util.prefs.FileSystemPreferencesFactory");
43          
44          props.setProperty("os.arch", "i386");
45          props.setProperty("os.name", "Linux");
46          props.setProperty("os.version", "2.4.9-31smp");
47          
48          props.setProperty("file.encoding", "ISO-8859-1");
49          props.setProperty("file.encoding.pkg", "sun.io");
50          props.setProperty("file.separator", "/");
51          
52          props.setProperty("line.separator", "\n");
53          
54          props.setProperty("path.separator", ":");
55          
56          props.setProperty("user.country", "US");
57          props.setProperty("user.dir", "/u/jwhaley/joeq");
58          props.setProperty("user.home", "/u/jwhaley");
59          props.setProperty("user.language", "en");
60          props.setProperty("user.name", "jwhaley");
61          props.setProperty("user.timezone", "");
62  
63          // must be at end: classpathToString() uses some properties from above.
64          props.setProperty("java.class.path", PrimordialClassLoader.loader.classpathToString());
65  
66          return props;
67      }
68      
69  }