javax.comm "no serial ports found" issue when run BlackBox

I got "no serial ports found" problem when run javax.comm library sample.

My environment:
[OS] WinXP SP3 32bit
[JDK] jdk1.5.0_11
[javax.comm verison] Javacomm20-win32

Description: I placed my javax.comm files into following directories: (reference page)
  • Copy win32comm.dll to C:\Program Files\Java\ jdk1.5.0_11\jre\bin
  • Copy comm.jar to C:\Program Files\Java\ jdk1.5.0_11\jre\lib\ext
  • Copy javax.comm.properties to C:\Program Files\Java\ jdk1.5.0_11\jre\lib
I set CLASSPATH as below:
c:\commapi\samples\Blackbox\BlackBox.jar;C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext\comm.jar;C:\commapi\samples\Simple
Then I got  "no serial ports found" error when run java BlackBox

Solution:
I try to do following change
  • copy win32com.dll to C:\Program Files\Java\jre1.5.0_11\bin
  • Copy javax.comm.properties to C:\Program Files\Java\jre1.5.0_11\lib
Then PORT_OWNED correctly.

Additional test: I try to compile SerialDemo and run it. It's works. (reference page)

留言

這個網誌中的熱門文章

IR的解碼編碼

檔案權限設定