2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 /** This class prints out the system properties.
23 We cannot print the strings directly because of encoding issues. Since
24 about 1.3.1 one can start java with the option -Dfile.encoding=UTF-8, but
25 unfortunately this works only with later update - versions (for example,
26 1.3.1_07). Therefore we use this scheme. The property string has this form:
29 Every character is cast to an integer which value is printed, followed by a
30 space. If all characters of the string are printed, then a new line is printed.
32 public class JREProperties
34 public static void main(String
[] args
)
38 boolean bNoAccess
= false;
39 if(args
.length
> 0 && args
[0].equals("noaccessibility")) {
43 //We need to be able to switch this part off because
44 //it causes an exception if the DISPLAY variable has
45 //a false value. Setting the noaccessibility argument
46 //can be done by providing a sunjavaplugin.ini with
47 //the bootstrap parameter JFW_PLUGIN_NO_NOT_CHECK_ACCESSIBILITY
52 //This line is needed to get the accessibility properties
53 java
.awt
.Toolkit
.getDefaultToolkit();
57 System
.err
.println(e
);
62 Properties p
= System
.getProperties();
63 Enumeration e
= p
.propertyNames();
64 while (e
.hasMoreElements()) {
65 String sProp
= (String
) e
.nextElement();
66 String sCompleteProp
= sProp
+ "=" + p
.getProperty(sProp
);
67 char[] arChars
= new char[sCompleteProp
.length()];
68 sCompleteProp
.getChars(0, sCompleteProp
.length(), arChars
, 0);
69 for (int c
= 0; c
< arChars
.length
; c
++) {
70 System
.out
.print(String
.valueOf((int) arChars
[c
]));
71 System
.out
.print(" ");
73 System
.out
.print("\n");
78 System
.err
.println(e
);