Stable alternative to RXTX

JavaSerial PortRxtx

Java Problem Overview


After using RXTX for a number of different projects, I've come across many annoying discrepancies and issues that can only sensibly be put down to bugs in the library - deadlocks, race hazards, and monitor threads deep in the RXTX library being left open preventing the program from closing (even though all ports I was using have been closed!) Running the latest "unstable" version has helped a bit, but it's still far from where I'd call it reliable, and activity on the project seems rather low at present.

However, searching for free cross-platform alternatives to RXTX doesn't seem to come up with much else.

Is there another library that anyone's tried with more luck? I don't need parallel port support, just serial, and it doesn't necessarily have to be compatible with RXTX or the javax.comm API.

Java Solutions


Solution 1 - Java

We have moved to java-simple-serial-connector which seems to be very stable and comfortable at the current release 0.9.0. For now, it works on windows and linux systems. We use it for modem interactions.

Solution 2 - Java

There's jSerialComm too.

Serial communication in Java is a mess. I've had trouble with jSSC with a virtual usb serial on linux, but with serial-comm it connected.

RXTX is a mess.

At least I think that now this SO question has all of the worth mentioning serial communication java libraries.

Solution 3 - Java

There's a few of them out there now, now that Arduino is pretty popular.

There's Serialio

and PureJavaComm, but it's pretty early on in development from what I can see.

it really depends on what your needs are. RXTX has been ported pretty much everywhere, so it is widely available.

Solution 4 - Java

One of the issues of RXTX I faced was the delay closing the port. When checking with setserial the port configuration I discovered a parameter closing_delay=3000. This means that the port closes 3 sec after the close() method was executed. Resetting the closing_delay toany value is ignored by RXTX. RXTX insists in 3sec delay.

the JSSC library performed to our satisfaction

Solution 5 - Java

Serialio lib is $49/platform/developer seat which gets you unlimited distribution in unlimited apps so not too pricey. The Mac library has been stable and reliable for us in an undemanding application and availability/compatibility has been good throughout for the various Mac platforms and OS/X releases.

Solution 6 - Java

I use socat configured to serve a socket for a serial port. The downside is that baud rate etc. is given to the socat invocation, it is not something you can readily alter from your program. On the upside is I can connect across a network without anything more than changing the IP address I connect to.

Solution 7 - Java

jSerialCom is good ! 'https://github.com/Fazecast/jSerialComm';

And here is its' wiki page: https://github.com/Fazecast/jSerialComm

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichael BerryView Question on Stackoverflow
Solution 1 - JavasebastianView Answer on Stackoverflow
Solution 2 - JavamiguelcobainView Answer on Stackoverflow
Solution 3 - JavaMikeView Answer on Stackoverflow
Solution 4 - JavasjpapaView Answer on Stackoverflow
Solution 5 - Javauser3284703View Answer on Stackoverflow
Solution 6 - Javauser2543191View Answer on Stackoverflow
Solution 7 - JavaJames WangView Answer on Stackoverflow