Last touched upon in this article dated August 2011, it's high time to revisit the state of Java serial port communications options for the following reasons:
In my customer experiences, RxTx, despite its age, still gets mentioned most when considering serial communications with Java. For whatever reasons, the RxTx project has gone off line, and access to the project source code is not readily available. Fortunately, we have a copy, and have made a few enhancements such that:
The source code is based upon the original 2.1-7r2 version and in this instance is now called 2.1.7r2-Java8. You can download the source here. If you want to get a feel for the changes made, take a look at this file: JAVA8_MODS.txt which can be found in the main directory of the source code. To build RxTx on your native platform:
$ tar xvf 2.1.7r2-Java8.tar.gz
$ cd 2.1.7r2-Java8/
The Java Simple Serial Connector, or jSSC for short, is another open source project that can be found here: http://code.google.com/p/java-simple-serial-connector/. It is available for a host of processor/OS combinations and, in addition to source availability, comes bundled in binary form too. Here's a list of supported platforms for its current 2.6.0 release:
Win32 Win64 Linux_x86 Linux_x86_64 Linux_ARM Solaris_x86 Solaris_x86_64 MacOSX_x86 MacOSX_x86_64 MacOSX_PPC MacOSX_PPC64
Like RxTx, it contains a native component but is packaged in a nice transparent fashion. The one potential challenge here may be in trying to figure out how to support a new platform that isn't on this list. I didn't have a whole lot of success finding out how to build the binary, and admittedly didn't spend an inordinate amount of time trying to figure it out either. Nonetheless, this project is gaining in popularity and has a dedicated individual supporting the software.
OpenJDK Device I/O
Finally, a project is underway to treat serial communication and device I/O in general as a first class citizen for the Java SE standard. The wiki can be found here: https://wiki.openjdk.java.net/display/dio/Main. It is based on the work done to provide device I/O to the Java ME 8 platform. Further solidifying the universality theme of Java 8, the ultimate goal would be to have a consistent device I/O API across both Java SE and Java ME. If you want to further understand what those APIs look like you can view them here: http://docs.oracle.com/javame/8.0/api/dio/api/index.html.
In conclusion, support for serial communications in Java SE is -- albeit slowly -- progressing. There are multiple open source projects and commercial alternatives too. Ideally, it will be great to see a formal API supported by the Java SE Standard.