Javax.comm API on 64-bit Windows

70,423

Solution 1

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.

Solution 2

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.

Solution 3

it seem the win32com.dll does not work with 64-bit Operating system

I think that is correct. In fact, according to the relevant download page, Oracle no longer supports the javax.comm API for any Windows platform.

However, I found this page which has a 64bit build of the DLL, among other things.

EDIT

By an astounding piece of research (i.e. following the links and reading stuff) I found the download page for the latest RXTX, which claims to have binaries for various platforms. If your platform is not there, try building from source. If that doesn't work, consider investing the effort in making it work.

Solution 4

I've integrated RXTX libraries into some of my earlier projects and i found out this bug it has while working with comm ports under windows, so you might want to check this first before going into some serious app design. Communication works fine, never had any problem with that, but once you open the port you cannot close it and reopen, if you use method provided for closing port, your app just hangs, no exception no nothing. I found later the same behavior described by users on web, but never really found the solution to this problem. Again, this might help you save some time, check it first.

Latest release, which is this http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, doesn't have this issue no more. Unfortunately i think its solved only for windows, its still there on Linux binaries, and i haven't tried it on mac.

Solution 5

Have you got a look on RXTX ? I think it is still active.

Share:
70,423
Nathi
Author by

Nathi

Updated on December 16, 2020

Comments

  • Nathi
    Nathi over 3 years

    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.

  • Nathi
    Nathi over 13 years
    Thank you Stephen, i visited the link euclideanspace.com/software/language/java/comm you referred to and i see that this package is for Linux. I wanted a package for the windows however.
  • Nathi
    Nathi over 13 years
    Hi Peter I have got the RXTX, but I have problems on how to use it. I wish I could get few sample code that uses RXTX
  • Nathi
    Nathi over 13 years
    Are you saying that the rxtx package has the same classes and methods as does the javax.comm? i am not sure if i can use the same same same procedure as i did on the javax.comm.
  • PeterMmm
    PeterMmm over 13 years
    It is all explained here rxtx.qbang.org/wiki/index.php/Using_RXTX , did you read this ?
  • kaliatech
    kaliatech over 13 years
    In an older versions of RXTX, yes. You could use the javax.comm packages and classes of the Java COMM API, with RXTX being a simple drop-in implementation replacement. In newer versions of RXTX, you will need to change imported packages from "javax.comm.*" to "gnu.io.*". Other than that, classes and API will be probably 99% the same. Compare the two API's here: rxtx.qbang.org/wiki/index.php/Development .