javausbusb4java

Try to use usb4java highlevel librairie


So here it is my program:

public static void main(String[] args) {
    UsbServices services = null;
    try {
        services = UsbHostManager.getUsbServices();
        hub = services.getRootUsbHub();
    } catch (SecurityException | UsbException e) {
        System.out.println(e.getMessage());
        e.printStackTrace();
    }   
}

And I have created the file 'javax.usb.properties' with inside:

javax.usb.services = org.usb4java.javax.Services

Like it's said in the documentation

At the moment of 'getRootUsbHub()' I have this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/builder/HashCodeBuilder

Does someone know why the method getRootUsbHub() doesn't work ?


Solution

  • You miss the commons-lang3.jar in your classpath. Download and add it.