Trouble in serial java program on linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suryawati
    New Member
    • Sep 2007
    • 2

    #1

    Trouble in serial java program on linux

    Dear All,

    I am running a java serial program ( Black Box on commapi package ) on a Linux. But when Main Menu can displayed, automatically program stop for running and I can't do anything with what's displayed, for examples: the button can't be pressed, the combo box can't be schrolled, etc. One thing that make me confused is threre's no error message at all, with all of happened.

    I had done somethings like :
    - put jar.com file on dir: usr/java/jdk/jre/lib/ext
    - put javax.comm.prop erties file on dir: usr/java/jdk/jre/lib
    - put libLinuxSerialP arallel_g.so and libLinuxSerialP arallel.so on dir: usr/lib
    - set path on usr/java/jdk/bin
    - set java home on usr/java/jdk

    I had checked my current java with "which java" command and the result is suitable with path set.

    I ran the Black Box program with command :
    java -Djava.library.p ath=/usr/lib Black Box

    where dir /usr/lib is directory that files .so located and Black Box is a class file name that is executed.

    My question is : what's the trouble?? Is there in connection with respond rate of operating system that I used, because when my Black Box is executed on windows platform, the result is running and respond well.

    My computer spec : Intel Pentium 4 with RAM 128 MB (but i'm not suggested that it's the reason).

    Could somebody help me? I'll wait for your respond to solve the trouble, soon. Thanks a lot.

    regards,
    Endang Suryawati
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    I had a lot of trouble trying to run Sun's old comm API on linux boxes. It did run
    fine (although a bit slow) on Windows boxes. Finally I replaced it all with the
    RXTX package and all ran fine within a couple of minutes.

    The RXTX API is identical to Sun's version; it just uses different package names.

    kind regards,

    Jos

    Comment

    • suryawati
      New Member
      • Sep 2007
      • 2

      #3
      Yup, Black Box sample is the only one that i'm sure it can running well anytime. The fact it can run on other computer, but when it runs on my computer is not running.

      The first, I'm not sure about RXTX, but now I'll try to download and implement RXTX API for running my java serial application.

      Thanks JosAH,

      regards,
      endang

      Originally posted by JosAH
      I had a lot of trouble trying to run Sun's old comm API on linux boxes. It did run
      fine (although a bit slow) on Windows boxes. Finally I replaced it all with the
      RXTX package and all ran fine within a couple of minutes.

      The RXTX API is identical to Sun's version; it just uses different package names.

      kind regards,

      Jos

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        I just remembered: that BlackBox example needs to be edited a bit because the
        names of the serial ports are different on both OSes: Windows: COM1 Linux: /dev/ttyS

        Look at the source code, you'll see it immediately.

        kind regards,

        Jos

        Comment

        Working...