Java on UDOO

Discussion in 'Application & Utilities' started by xwalter, Oct 1, 2014.

  1. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    I have installed eclipse from the lubuntu software center , and I wrote a simple GUI application using awt package .
    It's working
    But now I would like to install rxtxcomm for java , famous library to handle the serial port .
    Reading the documentation about rxtxcomm , they say that I have to install rxtxcomm.jar and rxtxcomm.so into the java home directory
    At the moment I did these operation to know where is my java openjdk and to set up the JAVA_HOME path .
    By the terminal I tape

    which java -> answer /usr/bin/java
    export JAVA_HOME =/usr/bin/java
    export PATH=$JAVA_HOME/bin:$PATH

    these operations were done without any pronlems
    But before to install rxtxcomm.jar and rxtxcomm.so I want to know if my procedure is correct ...
    Somebody know if I'm doing right ?
    Thanks
    Walter
     
  2. indianerjones

    indianerjones New Member

    Joined:
    Mar 10, 2014
    Messages:
    18
    Likes Received:
    1
    Does not seem wrong. However, there are two things to consider:
    1. Have you downloaded an actual ARM library? Or did you download an x86 one?
    2. A quick googling tells me there is a package in the Ubuntu software repo. Have you tried that?
    http://stackoverflow.com/questions/1138 ... 4-netbeans
     
  3. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    yes, I know what you mean .......
    I already had installed x86 and i32 version of rxtxcom but as I wrote in a post , they doesn't work because these library are done for iCore , ia32 and other architecture of processor different then ARM .....
    I have seen the stack overflow article and I'm trying to download the corret version of the library because the original web site is off.
    I think the correct library is used by the freedomotic ...I have downloaded freedomotic-bender-5.5.1
    The rxtxcom library I have downloaded is for ARM processor
    librxtxSerial.so -> 166 k
    RXTXcomm -> 59 k

    I hope to do right .... :?
     
  4. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    I solve some problems but now when I start my application I have this error message


    run:
    Stable Library
    =========================================
    Native lib Version = RXTX-2.2pre2
    Java lib Version = RXTX-2.1-7
    WARNING: RXTX Version mismatch
    Jar version = RXTX-2.1-7
    native lib Version = RXTX-2.2pre2
    gnu.io.NoSuchPortException

    at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)
    at netbeans1.TwoWaySerialComm.connect(TwoWaySerialComm.java:12)
    at netbeans1.Netbeans1.main(Netbeans1.java:14)
    BUILD SUCCESSFUL (total time: 1 second)


    Maybe now I have two RXTXcomm library .... :?
    This error because I have added the RXTXcomm.jar from a folder (/home/ubuntu)
    But How can I find the other RXTXcomm.jar , if it exist ?
    If I find the other jar file I can remove this from the project and to add the other one
    Well , I don't know .....
     
  5. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    for me is impossible to solve this problem , udoo use the serial port ttymxc3 with other application such as Arduino ide , but I don't know where to find this library .when I try to install RXTXcomm.jar and librxtx.so and I launch a simple application there are several problems and arduino doesn't work anymore .........
    Two weeks to understand this problem without success , and after I saw milion of web pages, Raspberry books also but there are some differences between the two systems , I don't know in the 2014 is difficult to use a serial port
    I don't want to use Android adk just for a serial port .I want to use ubuntu on my udoo but this is not easy
    Very bad situation
     
  6. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    using these commands by the terminal ....
    sudo find / -name RXTXcomm.jar
    I have discovered that Arduino IDE (which it works over java) uses already this library , as I thought ......
    Pratically the answer of terminal is
    /opt/arduino-1.5.4/lib/RXTXcomm.jar is the location where the library is registered .
    Now I want to reinstall Netbeans and I add the library from this directory ....
     
  7. iNura

    iNura New Member

    Joined:
    Feb 18, 2015
    Messages:
    10
    Likes Received:
    0
    hello xwalter :),
    i'm having the same kind of problem, yet when I have written the same command of the terminal I found that there are many RXTXcomm.jar files in the system .. even when I added the file which you have specified I'm still getting the same error.

    could you please help? how did you fix it :) ?
     
  8. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  9. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    the rxtxcomm is already installed , you are right mr Andrea ....because Arduino IDE use that library .
    But the problem is how to use rxtxcomm in java code becaus ein eclipse for example I have added the external library but when i compile I get the same problem
    Also Eclipse is running slowly and the quad core cpu over the heat sink is hot ....
     
  10. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Could it be that you're linking not the right library in Eclipse?
     
  11. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    the problem is where to copy the ".so" file ....I think ".so" is like ",dll" in windows , pratically is the compiled library which connect directly to the driver ....isn't?
     
  12. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Yes, you're right, .so is the equivalent of dll in Windows
    Check: http://superuser.com/questions/71404/what-is-an-so-file
    Have you followed this tutorial? In particular, this part:

    If you are in a UDOO DUAL/QUAD distribution with the Arduino IDE preinstalled(UDOObuntu 1.0, Debian Wheezy 1.1) use the library contained in the /lib folder(this recompiled library handles properly the /dev/ttymxc3 internal serial of UDOO DUAL/QUAD):

    sudo cp /opt/arduino-1.5.4/lib/librxtxSerial-2.2pre1.so /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/arm/
    sudo cp /opt/arduino-1.5.4/lib/RXTXcomm.jar /usr/share/java/
    cd /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/arm/
    sudo ln -s librxtxSerial-2.2pre1.so librxtxSerial.so

    What error are you getting?
    What part don't you understand or it's explained badly?
     
  13. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    Dear Andrea .....
    sudo cp /opt/arduino-1.5.8/lib/librxtxSerial.so /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/arm/
    ....better....
     
    Last edited: Feb 7, 2016
  14. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4

Share This Page