由以下原因引起:org.usb4java.LoaderException:在类路径 /org/usb4java/windows-x86_64/libusb-1.0.dll 中找不到本机库

Caused by: org.usb4java.LoaderException: Native library not found in classpath /org/usb4java/windows-x86_64/libusb-1.0.dll

系统:

问题:

尝试在我的项目中使用 usb4java 包来 select 更正 USB 端口并开始通过它移动信息。我从 usb4java.org 下载了包,解压缩并将其添加到 java 构建路径的引用中。

import org.usb4java.Context;
import org.usb4java.LibUsb;
import org.usb4java.LibUsbException;

 private void initializeLibUsb() {
    int result = LibUsb.init(null);
    if( result != LibUsb.SUCCESS) {
        throw new LibUsbException("Unable to initialize libusb.",result);
    }
}

这会导致错误:

Caused by: org.usb4java.LoaderException: Native library not found in classpath: /org/usb4java/windows-x86_64/libusb-1.0.dll

我应该从哪里获得 libusb-1。0.dll?

在类路径中包含文件 lib/libusb-1.0-windows-x86_64.jar