Problems with native libraries on UDOO

Discussion in 'Troubleshooting' started by JDorval, Jan 23, 2014.

  1. JDorval

    JDorval New Member

    Joined:
    Jan 23, 2014
    Messages:
    5
    Likes Received:
    0
    Hello, i've tried multiple projects with external Jars and natives.
    Everytime i try to launch, I get unsatisfiedlink errors,

    I try to use the -Djava.library.path option and it is not working... i also tried to create runnable jars, fat jar but i'm always getting this error.
    I've also tried to do:
    Code:
    static{
    		try
    		{
    			System.load("test_lib/librxtxSerial.so");	
    		}catch(UnsatisfiedLinkError e)
    		{
    			e.printStackTrace();
    			System.exit(1);
    		}
    Directly in the main class, but no success... Anyone have a solution or any hint ? Thanks :)

    It's working perfectly fine on a ubuntu PC..
     
  2. swoofer

    swoofer New Member

    Joined:
    Dec 26, 2013
    Messages:
    9
    Likes Received:
    0
    i have same problem HELP ME!!!
     
  3. venkatbo

    venkatbo Member

    Joined:
    Jun 14, 2013
    Messages:
    45
    Likes Received:
    1
    What is the stack trace - an FNF kind of msg maybe ?
    /v
     
  4. swoofer

    swoofer New Member

    Joined:
    Dec 26, 2013
    Messages:
    9
    Likes Received:
    0
    ubuntu@udoo:~/Desktop/test/libs$ ls
    RXTXcomm.jar librxtxSerial.so
    ubuntu@udoo:~/Desktop/test/libs$ cd ..
    ubuntu@udoo:~/Desktop/test$ ls
    Wodka_fat.jar libs
    ubuntu@udoo:~/Desktop/test$ java -jar Wodka_fat.jar
    java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
    at controller.utilities.SerialCommunicator.<init>(SerialCommunicator.java:28)
    at controller.WodkaController.<init>(WodkaController.java:27)
    at controller.WodkaController.main(WodkaController.java:50)
     
  5. venkatbo

    venkatbo Member

    Joined:
    Jun 14, 2013
    Messages:
    45
    Likes Received:
    1
  6. swoofer

    swoofer New Member

    Joined:
    Dec 26, 2013
    Messages:
    9
    Likes Received:
    0
    installing lib with terminal
    Code:
    sudo apt-get install librxtx-java
    After doing this, the libs should be in /usr/lib/jni
    Now just run the jar and tell the JVM to look in this folder for the library
    Code:
    java -Djava.library.path=/usr/lib/jni -jar FileName.jar 
    Sucess!
    thx for help
     

Share This Page