org.usb4java.LoaderException: Native library not found in classpath error

1.8k Views Asked by At

Am an trying to use the usb4java library with a project running in Ubuntu 64bit. I am getting the following error;

30 Jul 2015 09:46:16,225 INFO  Controller     : Working Directory: /opt/dock
Exception in thread "main" java.lang.ExceptionInInitializerError
    at uk.co.swimtag.control.Controller.findDevice(Controller.java:755)
    at uk.co.swimtag.control.Controller.startApplication(Controller.java:150)
    at uk.co.swimtag.control.Controller.main(Controller.java:104)
Caused by: org.usb4java.LoaderException: Native library not found in classpath: /org/usb4java/linux-x86_64/libusb4java.so
    at org.usb4java.Loader.extractLibrary(Loader.java:281)
    at org.usb4java.Loader.load(Loader.java:358)
    at org.usb4java.LibUsb.<clinit>(LibUsb.java:640)
    ... 3 more

Here are the two jars in the manifest file, and am sure the x86_64 lib is in the project;

 lib/mail.jar 
 lib/gson-1.6.jar 
 lib/usb4java-1.2.0.jar 
 lib/libusb4java-1.2.0-linux-x-86_64.jar 
 conf/

Any one had similar problems with usb4java. Probably something silly I have missed.

Thanks

1

There are 1 best solutions below

0
On

Maybe it is just a typo. But if you're sure the jar with natives is on your CLASSPATH, it may be that in your manifest file you wrote: libusb4java-1.2.0-linux-x-86_64.jar instead of libusb4java-1.2.0-linux-x86_64.jar