This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Just wanted to share my experience with the ranchers in case someone may have deal with this. It is not readily apparent when googling what someone has to do in order to connect to and communicate with serial ports. Javax.com, from what I understand is deprecated, although people seem to use it with varying degrees of success. The other option that I found was RXTX. I am using Ubuntu 32bit and Eclipse; my need was to use RS232. To use the API, download the Linux/x86 archive from the Downloads page and point your build path to the jar file which resides in the extracted folder. In addition, you have to associate a native .so file with the rxtx.jar file in order for the code to access the OS devices. For whatever reason, the only packed .so files were for 64 bit OS'. Upon running the file I got an ELF (EFL?) error which apparently means I was using a 64bit .so file on a 32 bit machine. I poked around their "toybox" directory and found a Linux 386 .so file that you can find here. Point to that .so file in the rxtx.jar file in hte native code path (In eclipse, Project Build Path). After that, I used this example to help me test and learn the API.
In most cases, I would recommend getting a Rs232 to Ethernet Server, assign it an IP and go to town using socket connections. It's a far more flexible solution imo.
In this case, I had a device that had an embedded USB to serial drive so it was connected to a USB port, yet the OS recognized it as a COM port; specifically /dev/ttyUSB0. The rxrtx api helped me access and communicate with the device.
Hope this helps folks!
"The greatest of all weaknesses is the fear of appearing weak." - JB Bossuet