What is the simplest 'free' way to implement serial comms in Java?
I'm new to Java, and have set myself a project to write so开发者_运维技巧 that I can do some "hands on" learning. I'm fluent with C++, but want to add another language to my skill-set.
Anyway, part of that project includes serial communications. I'm targeting a Windows XP platform, and cross-platform isn't really needed for this project.
I'm using NetBeans, and after quickly looking into things, I find that "in-built" support for serial communication doesn't exist any more.
Further searching led me to RXTX, however, after following the simple installation, their listed (on the wiki) example doesn't appear to work.
I have seen a couple of purchasable serial libraries, but I don't want to go down that path, at least not yet.
So, what is the best way forward? Persisting with RXTX and troubleshooting there? Or is there an alternate way that is simpler to use?
From here:
javax.comm package 3.0 has replace javax.comm 2.0:
Sun is no longer offering the 2.0 release of javax.comm, since 3.0 Update1 contains important bug fixes allowing to better support it..
javax.comm 3.x offers new conveniences for the the user, as well as improvements to the portmapping architecture and support for our Sun Ray thin client platform, with no change to the core API or functionality. Among the features available with javax.comm 3.0 is an interactive serial port tool, which is helpful in basic diagnosis of serial port connectivity.
javax.comm for Windows have been EOLed:
A Windows port of javax.comm is not currently offered by Sun. There has not been sufficient demand to justify supporting javax.comm on Windows, particularly considering that javax.comm for Windows is available from other sources, such as rxtx.
精彩评论