java中的Com端口问题
我正在尝试使用 Java 编写 COM 端口。但是当我调试时,它会给出一个带有复选框的窗口,用于选择显示的端口,
尚未检测到 gnu.io.rxtx.properties。 没有一致的方法来检测此操作系统上的端口。在进行正确的端口枚举之前,有必要指示哪些端口在此系统上有效。请检查在此系统上有效的端口,然后选择“保存”。
怎么才能解决这个问题呢。
I was trying to write COM port using Java. But when i debug, it gives a window with checkbox for selecting ports showing ,
gnu.io.rxtx.properties has not been detected.
There is no consistant means of detecting ports on this operating System. It is necessary to indicate which ports are valid on this system before proper port enumeration can happen. Please check the ports that are valid on this system and select Save.
How can solve this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要检查您的虚拟机是否具有初始化 COM 端口通信所需的文件?如果没有,您可能必须首先找到这些文件。
您可能想查看 webby:
http://www.oracle .com/technetwork/java/index-jsp-141752.html
如果您需要示例,请查看:
http://www.java2s.com/Code/Java/Development-Class/OpenaserialportusingJavaCommunications .htm
希望有帮助。
干杯,
弗恩
You will need to check if your VM have the required files to initialize the COM port communication? If none, you probably have to find those files first.
You might want to check out the webby at:
http://www.oracle.com/technetwork/java/index-jsp-141752.html
also if you need an example, checkout:
http://www.java2s.com/Code/Java/Development-Class/OpenaserialportusingJavaCommunications.htm
Hope it helped.
Cheers,
Vern
您所描述的窗口是 RXTX 库的一部分。 RXTXcomm.jar 有一个Configure 类,其中包含一个main 方法。您看到弹出窗口是因为您正在运行配置中的 main 方法,而不是调试您的应用程序。在调试器中,确保您实际上正在调试代码而不是 RXTX 库。
The window you are describing is part of the RXTX library. The RXTXcomm.jar has a Configure class which contains a main method. You are seeing the popup because you are running the main method from Configure and not debugging your application. In your debugger make sure you are actually debugging your code and not the RXTX library.
gnu.io
还有一个主类。默认情况下,Eclipse 选择 gnu.io 的 main 方法。在主类文本框中,使用搜索按钮选择您的类作为主类。您的问题应该得到解决
gnu.io
also has a main class. By default Eclipse picks the main method of gnu.io.In Main class textBox use the search button to select your class as the main class. Your problem should be fixed