Menu

java.lang.UnsatisfiedLinkError: ch.ntb.usb.LibusbJava.usb_error_no(I)I

Help
pff
2018-06-07
2018-06-19
  • pff

    pff - 2018-06-07

    ok i'm trying to follow these instructions https://github.com/tinwhisker/Owon-VDS1022 on fedora.
    I dont know anything at all about java whatsoever.

    i can't find a libusb-java package on my package manager.
    i followed the instructions here: http://libusb-java.ch/installation/start
    i run the jar file and get the folowing error: java.lang.UnsatisfiedLinkError: no usbJava in java.library.path

    so i renamed libLibusbJava-1_1.so to libusbJava.so and copied it into the working directory
    i run the jar file and get the following error: java.lang.UnsatisfiedLinkError: ch.ntb.usb.LibusbJava.usb_error_no(I)I

    i think this means it can't find the libusb jar file.
    i have tried moving the jar file into working directory, altering name case.

    java -verbose doesn't mention anything about loading the libusb jar file.

    so i don't really know what i'm doing and would appreciate any help thank you.

     
  • pff

    pff - 2018-06-08

    I realised i have been silly, rather than the 1.1 so and jar the project was built with ch.ntb.usb-0.5.9.jar so i need to use an older .so that uses old libusb.
    I didn't understand that the ch.ntb.usb-0.5.9.jar was the old version of libusbjava.
    I tried building an older version from svn but java segfaults on one of the get string methods.

     
  • nzasch

    nzasch - 2018-06-14

    Hi
    Have you found a way to get ch.ntb.usb-0.5.9.jar running in linux?

     
  • pff

    pff - 2018-06-19

    almost kind of...
    i did
    1) install libusb, libusbx from package manager. libusb is a wrapper for libusbx i think so need them bothe
    2) svn checkout then jump to revision 280, this afaik is the latest version that has the functions for 0.5.9 I THINK
    3) inside both libusbjava.cpp and libusbjava.h do a find/replace for inf_libubsjava_ -> usb_, this is where 0.5.9 expects to find the functions in the namespace or whatever its actually called.
    4) edit project.properties, i pointed /usr/lib to /usr/lib64 because thats where my libusb.so were and also under linux specific i put in my paths for openjdk, (uncomment and modify includes2 and uncomment includes3), do "find / -iname "jni.h"" to get the path for includes2
    5) build with "ant -v linux", see if there are any complaints. i get plenty of warings but no errors, if files are missing check your paths in project.properties.
    6) copy .so to somewhere your 0.5.9 jar can find it.

    the reason i got a segfault earlier was apparently i don't have the correct permissions to query usb devices, running as root doesn't crash but now i have
    LibusbJava.usb_set_configuration: Numerical result out of range
    I'm too annoyed about the permissions thing to look into it right now but i'm sure theres something in the svn log about accepting numbers >0 vs >=0 but i can't remeber what it was for exactly.

    good luck nzasch keep me updated how you go.

     
  • nzasch

    nzasch - 2018-06-21
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.