Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import java.util.Properties;
- public class SystemPropertiesAndEnvironmentVariables {
- public static void main(String[] args) {
- System.out.println("-----------------------------------------------------------------------------------------");
- System.out.println("System Properties:");
- final Properties properties = System.getProperties();
- properties.list(System.out);
- System.out.println("-----------------------------------------------------------------------------------------");
- System.out.println("System Environment Variables:");
- for (final Map.Entry envEnt : System.getenv().entrySet()) {
- System.out.println(envEnt.getKey() + " = " + envEnt.getValue());
- }
- System.out.println("-----------------------------------------------------------------------------------------");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement