Javax.comm API on 64-bit Windows

Nathi picture Nathi · Oct 18, 2010 · Viewed 68k times · Source

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.

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.

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.

Answer

Alan picture Alan · Sep 6, 2012

This is how I got it to work.
I've tested it using JDK 1.6 (32bit) on my Windows 7 64bit machine.

  1. Install 32bit JDK.
  2. Copy 'win32com.dll' to JDK_HOME\jre\bin.
  3. Copy 'javax.comm.properties'to to JDK_HOME\jre\lib.
  4. Copy 'comm.jar'to to JDK_HOME\jre\lib\ext.

Now run your program and it should work.