Skip to content

Instantly share code, notes, and snippets.

@asmaier
Created April 8, 2014 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asmaier/10124772 to your computer and use it in GitHub Desktop.
Save asmaier/10124772 to your computer and use it in GitHub Desktop.
Small java program showing a sorted list of all java system properties. Useful for debugging, e.g. encoding issues. Compile and run with "javac ShowSystemProperties.java; java ShowSystemProperties".
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
/**
* Shows a sorted list of all system properties
*/
public class ShowSystemProperties {
public static void main(String[] argv) {
Properties props = System.getProperties();
Map<Object,Object> sorted = new TreeMap<>(props);
for(Map.Entry<Object,Object> e : sorted.entrySet()) {
System.out.println(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment