boolean (String binPath) { String osName = System.getProperty("os.name").toLowerCase(Locale.ENGLISH); if (osName.startsWith("windows")) { String arch = System.getProperty("os.arch").toLowerCase(Locale.ENGLISH); //noinspection SpellCheckingInspection String libName = "x86_64".equals(arch) || "amd64".equals(arch) ? "breakgen64.dll" : "aarch64".equals(arch) || "arm64".equals(arch) ? "breakgen64a.dll" : "i386".equals(arch) || "x86".equals(arch) ? "breakgen.dll" : null; // see also: `ProcessProxyImpl#canSendBreak` if (libName != null) { File libFile = new File(binPath, libName); if (libFile.isFile()) { System.load(libFile.getAbsolutePath()); return true; } } } return false; }