Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javax.comm API on 64-bit Windows

Tags:

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.

like image 275
Nathi Avatar asked Oct 18 '10 13:10

Nathi


2 Answers

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.

like image 150
Alan Avatar answered Oct 18 '22 10:10

Alan


Recent 2.2pre versions of RXTX include binaries for 64-bit windows. I think the latest RXTX information source has changed to this: http://rxtx.qbang.org instead of http://www.rxtx.org though.

At one point the RXTX library included drop-in support for using the javax.comm api. I'm not sure if it still does, but the main change then to use the "native" RXTX packaging was primarily just a package name change.

like image 40
kaliatech Avatar answered Oct 18 '22 10:10

kaliatech