dmidecode4j is a lightweight, free Java library that parses human-readable dmidecode output and deserializes it into strongly-typed Java entities.
- Any Linux distributions that support
dmidecodewill be able to use this library
⚠️ Root privileges are required to run dmidecode.
Minimum Supported Java Version: 8
Maven:
<dependency>
<groupId>io.github.eggy03</groupId>
<artifactId>dmidecode4j</artifactId>
<version>VERSION</version>
</dependency>Gradle:
implementation group: 'io.github.eggy03', name: 'dmidecode4j', version: 'VERSION'Replace
VERSIONwith the latest version available in maven central
For other build ecosystems, check out the Maven Central Repository
Note
The sources.jar published with this library includes de-lomboked code which should prevent the IDEs from complaining
about source mismatch between the decompiled class files and the downloaded sources. It should also make your debugging
easier, should you step into the library code during the debugging process of your project.
public class ProcessorExample {
public static void main(String[] args) {
DMIProcessorService service = new DMIProcessorService();
Optional<DMIProcessor> processor = service.get(10L);
processor.ifPresent(System.out::println);
// can also access individual metrics via the getters
}
}This project is licensed under the MIT License.