Forum Stats

  • 3,837,409 Users
  • 2,262,256 Discussions
  • 7,900,271 Comments

Discussions

Support for javax.comm api

860005
860005 Member Posts: 3
edited May 6, 2011 8:58AM in Java Native Interface (JNI)
Hello,

I coded a program that reads NMEA sentences from the GPS devices. I used a serial port connection with the device and JAVAX.COMM API for serial port programming. The program is running smoothly in windows OS.

I want to run the code on development kit, I installed linux and GCJ on the device. But the problem is GCJ give error while compiling serial code. (all javax.comm methods)

I was wondering, if you could help me solve this problem.

Regards,
Wasif Iqbal
Tagged:

Answers

  • gimbal2
    gimbal2 Member Posts: 11,949 Gold Trophy
    If you have to resort to GCJ, you are already on thin ice and should rethink your strategy. I'd say you don't need Java but you need a native C/C++ application. In any case, a Google search for "gcj java comm" resulted in this as the first hit:

    http://stackoverflow.com/questions/1835531/java-compiled-with-gcj-using-javax-comm-api-possible

    Amazing what a simple Google query can tell you in under a second, huh?
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    GCJ is not a Java compiler, and it relies on a library called GNU CLASSPATH which isn't Java either. Don't use it, and don't ask about it here, this site is for Java as defined by the Sun/Oracle specifications.
  • 860005
    860005 Member Posts: 3
    Thank you for replying.

    I have a complete java program, the problem is that i dont know how to compile it on embeded linux 2.6.86. I googled it and gcj came up in search results. Can you assisst me in this problem.

    I m using ok6410 development kit (arm board). It is with wince 6 or linux 2.6.86. I have whole coding in java which is tested in windows OS.

    How can i compile my code in above mentioned kit?
  • 860005
    860005 Member Posts: 3
    Yes i did googled it and came accross that answer which i didnt understand. Can u suggest me any other compile that will run in

    Embeded linux 2.6.86 (Debian)

    The problem is i have done all my coding in java.
  • gimbal2
    gimbal2 Member Posts: 11,949 Gold Trophy
    857002 wrote:
    Yes i did googled it and came accross that answer which i didnt understand. Can u suggest me any other compile that will run in

    Embeded linux 2.6.86 (Debian)

    The problem is i have done all my coding in java.
    Java classes are cross-platform. If there is a Java runtime for this Linux version then you can run them even if you compiled them on Windows. If there is no compatible Java runtime then you should have done your research before writing the code.
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    How can i compile my code in above mentioned kit?
    Download and install a JDK from Sun/Oracle for the platform and use the 'javac' command.
This discussion has been closed.