System:

  • Windows 10 64-bit
  • Eclipse Photon

Problem:

Trying to use usb4java package in my project to select correct usb port and start moving information through it. I downloaded the package from usb4java.org, unzipped and added it to the references from java build path.

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

Where am I supposed to get the libusb-1.0.dll?

1

There are 1 answers

0
sander On BEST ANSWER

Included the file lib/libusb-1.0-windows-x86_64.jar in the classpath.