简体   繁体   English

引起原因: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

System : 系统

  • Windows 10 64-bit Windows 10 64位
  • Eclipse Photon Eclipse光子

Problem: 问题:

Trying to use usb4java package in my project to select correct usb port and start moving information through it. 尝试在我的项目中使用usb4java包来选择正确的usb端口并开始通过它移动信息。 I downloaded the package from usb4java.org, unzipped and added it to the references from java build path. 我从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);
    }
}

This results in the error: 这导致错误:

Caused by: org.usb4java.LoaderException: Native library not found in classpath: /org/usb4java/windows-x86_64/libusb-1.0.dll 引起原因:org.usb4java.LoaderException:在类路径中找不到本机库:/org/usb4java/windows-x86_64/libusb-1.0.dll

Where am I supposed to get the libusb-1.0.dll? 我应该在哪里获得libusb-1.0.dll?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM