Native library not found in classpath

52 views
Skip to first unread message

Vito Falanga

unread,
Oct 6, 2020, 12:24:47 AM10/6/20
to usb4java

Hello, I have a problem. When I launch a program that requires usb4java I get this error:

Exception in thread "main" 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.javax.Services.<init>(Services.java:59)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.Class.newInstance(Class.java:584)
at javax.usb.UsbHostManager.createUsbServices(Unknown Source)
at javax.usb.UsbHostManager.getUsbServices(Unknown Source)
at com.tacteasy.ver1.init(ver1.java:112)
at com.tacteasy.ver1.<init>(ver1.java:101)
at com.tacteasy.ver1.main(ver1.java:466)

How can I solve? I use debian ... Thank you...

Vito

Dennis Sheirer

unread,
Oct 6, 2020, 3:52:50 AM10/6/20
to usb4java
You have to include the location of the native libraries on your classpath (-cp) so that java knows where to find the libraries.

java -cp librarylocation compiled.class

deb...@alice.it

unread,
Oct 7, 2020, 9:41:46 AM10/7/20
to usb4...@googlegroups.com
Forgive my ignorance, but i don't know how to execute the command

java -cp...

What does librarylocation refer to?

And classpath?

Thanks...
Vito




----Messaggio originale----
Da: dennis....@gmail.com
Data: 6-ott-2020 9.52
A: "usb4java"<usb4...@googlegroups.com>
Ogg: [usb4java] Re: Native library not found in classpath
--
You received this message because you are subscribed to the Google Groups "usb4java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to usb4java+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/usb4java/20159f99-2367-4904-b2fe-9d8ed16bad26n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages