Getting system information with the SystemUtils class from Apache Commons Lang

Apache Commons Lang has quite a neat class to be able to find out information about the system you’re currently working on.
It’s called SystemUtils and has both static methods and constants to get the information. You could get much of that information by fetching system properties, but then you need to know the name of these properties and it is not easy to remember all these.
It’s very straightforward to use the SystemUtils class as the following example shows. The code below shows just a small part of the information that the class can return, so just download the library and test for yourself or browse through the API documentation that can be found on their site (search for Apache Commons Lang).

Here is the output when the code above is run:

Search for more Java info on this site here:
Custom Search

Please type any questions here.