How to communicate with a USB device under Windows and Java?

41,673

Solution 1

I did quite a bit of research on this some time ago, and the unfortunate fact was that all the useful free USB+Windows+Java projects were dead. There is commercial and expensive (price $39.99 is not per developer, but per copy of your software sold!) JCommUSB library which probably works, although I have no experience of it; we had to build our own custom C wrappers to the USB drivers and communicate with them through JNI.

Solution 2

libusb-win32 requires you to install their generic driver, which then makes a USB device available to you. I'm not sure that it's possible to do driver-less access of an USB device unless the device belongs to one of several standard classes (storage and HID, in particular).

There is a Java wrapper for libusb-win32 which might work for you. I haven't used it myself, though.

Share:
41,673
Gili
Author by

Gili

Email: cowwoc2020 at gmail dot com.

Updated on July 09, 2022

Comments

  • Gili
    Gili almost 2 years

    I'd like to communicate with a USB device under Windows and Java but I can't find a good library to do so. I don't want the user to have to install any extra hardware or device drivers to make this work. That is, I want to be able to interact with USB just like other Windows applications do.

    I am familiar with jUSB and JSR 80 but both seem to be dead projects (at least for Windows).

  • Gili
    Gili about 15 years
    Don't all USB devices ship with on-board drivers which get installed automatically when you plug the device in? Or is this just for "standard" devices? Is it at least possible to communicate with "standard" devices using Java without drivers?
  • Joonas Pulakka
    Joonas Pulakka about 15 years
    No, on-board drivers are an exception. Standard devices, such as storage and HID (keyboards, mouses etc.) would probably work with the above mentioned libusb-win32. Windows includes standard drivers for them.
  • 8bitwide
    8bitwide almost 12 years
    I have been looking for a simple way to interact with a custom USB device that didn't involve emulating a comm port, Thanks
  • Cypher
    Cypher about 9 years
    Looks like the JCommUSB library is dead as well.The domain name is up for sale.