4 /** This class prints out the system properties.
6 We cannot print the strings directly because of encoding issues. Since
7 about 1.3.1 one can start java with the option -Dfile.encoding=UTF-8, but
8 unfortunately this works only with later update - versions (for example,
9 1.3.1_07). Therefore we use this scheme. The property string has this form:
12 Every character is cast to an integer which value is printed, followed by a
13 space. If all characters of the string are printed, then a new line is printed.
15 public class JREProperties
17 static public void main(String
[] args
)
21 boolean bNoAccess
= false;
24 if (args
[0].equals("noaccessibility"))
28 //Find out on what operation system we are running. On Windows 98
29 //we must not call getDefaultToolkit, because the office may freeze
32 String os
= System
.getProperty("os.name");
37 if (os
.equalsIgnoreCase("Windows 98") ||
38 os
.indexOf("Windows 98") != -1)
42 //We need to be able to switch this part off because
43 //it causes an exception if the DISPLAY variable has
44 //a false value. Setting the noaccessibility argument
45 //can be done by providing a sunjavaplugin.ini with
46 //the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY
48 if (bNoAccess
== false && ! bW98
)
51 //This line is needed to get the accessibility properties
52 Toolkit tk
= java
.awt
.Toolkit
.getDefaultToolkit();
56 System
.err
.println(e
);
61 Properties p
= System
.getProperties();
62 Enumeration e
= p
.propertyNames();
63 for (; e
.hasMoreElements() ;) {
64 String sProp
= (String
) e
.nextElement();
65 String sCompleteProp
= sProp
+ "=" + p
.getProperty(sProp
);
66 char[] arChars
= new char[sCompleteProp
.length()];
67 sCompleteProp
.getChars(0, sCompleteProp
.length(), arChars
, 0);
68 for (int c
= 0; c
< arChars
.length
; c
++) {
69 System
.out
.print(String
.valueOf((int) arChars
[c
]));
70 System
.out
.print(" ");
72 System
.out
.print("\n");
77 System
.err
.println(e
);