I\'m writing an installer that will tune the configuration of the product for the particular hardware on which it will be run. In particular, I want to determine how much p
Have came across this question several times for the past few years. Most of the existing answers are hacking and platform dependent, so, there isn't any self-contained, platform independent tool-set out there for JAVA today?
Actually, there is one: https://github.com/oshi/oshi
OSHI is a free JNA-based (native) Operating System and Hardware Information library for Java. It doesn't require the installation of any additional native libraries and aims to provide a cross-platform implementation to retrieve system information, such as OS version, processes, memory & CPU usage, disks & partitions, devices, sensors, etc.
Yes, it did use JNI internally, as other methods do, but who cares about it if all the details are carefully hidden behind a clean API and the package are quite easy to install if you are using any decent, modern dependency management tools(maven, gradle, etc).
For any serious project, use this one. Don't reinvent the wheel.