mirror of
https://github.com/altercation/solarized
synced 2024-11-22 19:53:06 +00:00
17 lines
461 B
Java
17 lines
461 B
Java
|
import java.util.Map;
|
||
|
import java.util.TreeSet;
|
||
|
|
||
|
public class GetEnv {
|
||
|
/**
|
||
|
* let's test generics
|
||
|
* @param args the command line arguments
|
||
|
*/
|
||
|
public static void main(String[] args) {
|
||
|
// get a map of environment variables
|
||
|
Map<String, String> env = System.getenv();
|
||
|
// build a sorted set out of the keys and iterate
|
||
|
for(String k: new TreeSet<String>(env.keySet())) {
|
||
|
System.out.printf("%s = %s\n", k, env.get(k));
|
||
|
}
|
||
|
} }
|