30

Possible Duplicate:
Java Serial Communication on Windows

Friends, I want to connect and transfer data to COM PORT (either virtual or original) in JAVA?

0

3 Answers 3

40

This question has been asked and answered many times:

Read file from serial port using Java

Reading serial port in Java

Reading file from serial port in Java

Is there Java library or framework for accessing Serial ports?

Java Serial Communication on Windows

to reference a few.

Personally I recommend SerialPort from http://serialio.com - it's not free, but it's well worth the developer (no royalties) licensing fee for any commercial project. Sadly, it is no longer royalty free to deploy, and SerialIO.com seems to have remade themselves as a hardware seller; I had to search for information on SerialPort.

From personal experience, I strongly recommend against the Sun, IBM and RxTx implementations, all of which were unstable in 24/7 use. Refer to my answers on some of the aforementioned questions for details. To be perfectly fair, RxTx may have come a long way since I tried it, though the Sun and IBM implementations were essentially abandoned, even back then.

A newer free option that looks promising and may be worth trying is jSSC (Java Simple Serial Connector), as suggested by @Jodes comment.

Sign up to request clarification or add additional context in comments.

4 Comments

A quick to note to others: if you were looking for a FREE way to use the serial port do not click the link. You are wasting your time.
jSSC (Java Simple Serial Connector) is free, and I have found it extremely easy to use, and stable. Its developer is also very helpful. Highly recommended.
It appears that serialio.com does charge a distribution fee (royalty) for commercial products - and a rather steep one at that!
@KeithL: So it seems. They changed that since I used it years ago. Clearly, they felt they weren't being adequately compensated. Sad, really, it was, and presumably still is a best-in-class product.
7

The Java Communications API (also known as javax.comm) provides applications access to RS-232 hardware (serial ports): http://www.oracle.com/technetwork/java/index-jsp-141752.html

Comments

5

An alternative to javax.comm is the rxtx library which supports more platforms than javax.comm.

3 Comments

Java Communications API is just that - an API. Sun reference implementation is very limited, but SerialIO SerialPort (an enterprise grade solution) does implement Java Communications API
I understand that rxtx is an implementation of javax.comm
I've written an article about how to connect to a serial port using rxt, check it out: linkedin.com/pulse/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.