java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path

前端 未结 12 1015
南笙
南笙 2020-11-29 05:14

I am trying to use the 64 bit rxtx serial communication library (downloaded from cloudhopper) with 64bit windows 7 and eclipse. I get the message: java.lang.Unsatisfi

相关标签:
12条回答
  • 2020-11-29 05:53

    I had the same problem. So I installed JDK 32-bit and added those RxTx files(x86) to Program files(x86)/java/... folder instead of Program files/java... folder. Also I added those RxTx .dll files(x86) to /System32 folder. After that the problem was resolved in my application.

    0 讨论(0)
  • 2020-11-29 05:59

    You can also add a virtual machine argument:

    -Djava.library.path=c:\path\to\dll\
    

    or

    -Djava.library.path=/path/to/lib/
    

    That worked for me. Also refer to this question.

    0 讨论(0)
  • 2020-11-29 05:59

    I had the same issue, on windows 10 and eclipse, the probelm was i had java for 32 and 64 bits, so i installed RXTX library for 64 bits but eclipse was using the 32 bits java enviroment, so what i did was download RXTX for 32 bits copy the necessary files to C:ProgramFilesx86/JAVA_HOME as in the instructions for RXTX and the problem was solved. Hope this helps anyone.

    0 讨论(0)
  • 2020-11-29 06:01

    Hy, I had the same problem when integrating the RXTXcomm into Netbeans under Ubuntu 11.10. I am guessing that you are not copying the files in the right place, at least that was my problem.

    Under Ubuntu java is installed under usr/lib/jvm. BUT here I had a lot of forders (ex java-7-openjdk-i386, java-7-common, java-6-openjdk ...). In Netbeans I check what is the path of the JDK included into the project, it was java-7-openjdk-i386 . so I took the rxtxSerial.so (under windows it is rxtxSerial.dll) and copied it to java-7-openjdk-i386/jre/bin and it worked like a charm .

    I hope this helps.

    0 讨论(0)
  • 2020-11-29 06:03

    I resolve this problem by adding rxtxSerial.dll[jre 1.8.0_45/bin] and RxTxcomm.jar[jre 1.8.0_45/lib/ext]

    0 讨论(0)
  • 2020-11-29 06:03

    Under Netbeans 5.5 on Windows, I needed to right-click Libraries under Projects on the left hand side of the screen, and select "Add JAR/Folder", picking the RXTXcomm.jar file. Only then did my

    enter code here
    

    become a valid command. Also, I got a run-time error where it failed to load the rxtxSerial.DLL library because it couldn't find it. I needed to right-click the project name, select properties, select Run under categories, and add a VM Options: entry of

    -Djava.library.path="C:\where-ever-you-stuck-rxtxSerial.DLL-file;%PATH%

    Example:

    -Djava.library.path="C:\rxtx-2.1-7-bins-r2\Windows\i368-mingw32\;%PATH%"
    

    While I'm sure there is more than one way of adding the directory to your path, this worked for me. Note I did the default NetBeans 5.5/JDK 1.6.0 isntall accepting all the default options(ie clicking next until I got to finish), so I haven't modified my java paths or anything. Alternatively you can copy the *.dll into C:\Windows\System32\, Java will find it there automatically.

    Note that you cannot use the 32bit DLL when running a 64bit JRE: You will get an error similar to:

    Can't load IA 32-bit .dll on a AMD 64-bit platform thrown while loading gnu.io.RXTXCommDriver
    

    To solve this simply install the 32bit JDK and add a new Platform in Netbeans under Tools->Java Platforms->Add Platform and change the project settings to use the newly created platform. make sure you type

    "import gnu.io.*"

    from http://rxtx.qbang.org/wiki/index.php/Using_RXTX_In_NetBeans

    0 讨论(0)
提交回复
热议问题