Fixed NoClassDefFoundError when attempting to load plugin on 32-bit Windows

This commit is contained in:
Intelli 2024-10-03 15:56:29 -06:00
parent 385c11a3aa
commit 70ffeacbc0

View File

@ -124,6 +124,9 @@ public class Util extends Queue {
CentralProcessor result = null; CentralProcessor result = null;
try { try {
Class.forName("com.sun.jna.Platform"); Class.forName("com.sun.jna.Platform");
if (System.getProperty("os.name").startsWith("Windows") && !System.getProperty("sun.arch.data.model").equals("64")) {
Class.forName("com.sun.jna.platform.win32.Win32Exception");
}
Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF); Configurator.setLevel("oshi.hardware.common.AbstractCentralProcessor", Level.OFF);
SystemInfo systemInfo = new SystemInfo(); SystemInfo systemInfo = new SystemInfo();
result = systemInfo.getHardware().getProcessor(); result = systemInfo.getHardware().getProcessor();