1 | |
package org.codehaus.mojo.exec; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.Collections; |
5 | |
import java.util.List; |
6 | |
import java.util.Properties; |
7 | |
|
8 | 0 | public class Foo { |
9 | |
public static void main(String[] args) { |
10 | 0 | Properties props = System.getProperties(); |
11 | 0 | List<String> keys = new ArrayList<String>(props.stringPropertyNames()); |
12 | 0 | Collections.sort(keys); |
13 | 0 | for (String key : keys) { |
14 | 0 | if (key.startsWith("os") || key.startsWith("java")) { |
15 | 0 | System.out.println(key + "=" + props.getProperty(key)); |
16 | |
} else { |
17 | 0 | System.out.println(key); |
18 | |
} |
19 | |
} |
20 | 0 | System.out.println(props.getProperty("java.home")); |
21 | |
|
22 | 0 | } |
23 | |
} |