maven 引用
com.github.dblock
oshi-core
LATEST
取得 cpu信息 示例
importoshi.SystemInfo;importoshi.hardware.CentralProcessor;importoshi.hardware.HardwareAbstractionLayer;importoshi.software.os.OperatingSystem;public classComputerIdentifier
{public static String generateLicenseKey() throwsException
{
SystemInfo systemInfo= newSystemInfo();
OperatingSystem operatingSystem=systemInfo.getOperatingSystem();
HardwareAbstractionLayer hardwareAbstractionLayer=systemInfo.getHardware();
CentralProcessor centralProcessor=hardwareAbstractionLayer.getProcessor();
String vendor=operatingSystem.getManufacturer();
String processorSerialNumber=centralProcessor.getSystemSerialNumber();
String processorIdentifier=centralProcessor.getIdentifier();int processors =centralProcessor.getLogicalProcessorCount();
St