64位Windows上的Javax.comm API [英] Javax.comm API on 64-bit Windows
问题描述
我正在使用javax.comm API来帮助我的程序通过串口与硬件进行通信。我正在使用Windows 7和NetBeans IDE 9.
I am using the javax.comm API to help my program communicate with hardware over serial port. I am using the Windows 7 and NetBeans IDE 9.
我使用通用Java程序检查我的PC上的可用端口。程序编译并运行没有错误。然而它什么也没有回报
I used the common Java program to check the available ports on my PC. The program compiled and ran without error. However it returned nothing.
如何在Windows上使用javax.comm API?似乎win32com.dll无法与64位操作系统一起使用。
What can I do to use the javax.comm API on Windows? It seems win32com.dll does not work with a 64-bit operating system.
推荐答案
这就是我开始工作的方式。
我在Windows 7 64位机器上使用JDK 1.6(32位)进行了测试。
This is how I got it to work.
I've tested it using JDK 1.6 (32bit) on my Windows 7 64bit machine.
- 安装32位JDK 。
- 将'win32com.dll'复制到JDK_HOME \ jre \ bin。
- 将'javax.comm.properties'复制到JDK_HOME \\ \\ jre\lib。
- 将'comm.jar'复制到JDK_HOME \ jre \lib \ extra。
- Install 32bit JDK.
- Copy 'win32com.dll' to JDK_HOME\jre\bin.
- Copy 'javax.comm.properties'to to JDK_HOME\jre\lib.
- Copy 'comm.jar'to to JDK_HOME\jre\lib\ext.
现在运行你的程序,它应该可以工作。
Now run your program and it should work.
这篇关于64位Windows上的Javax.comm API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!