What is the simplest 'free' way to implement serial comms in Java?

不想你离开。 提交于 2019-12-11 09:07:14

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/2028192/what-is-the-simplest-free-way-to-implement-serial-comms-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!