Skip to content
Gary Rowe edited this page Oct 13, 2020 · 9 revisions

What is hid4java?

An out of the box solution to getting USB Human Interface Device (HID) equipment to "just work" with Java using the Java Native Architecture (JNA) and libusb/hidapi libraries.

The target audience is "hobbyist and commercial developers" familiar with USB.

Why should I use it?

It will allow you to communicate with HID devices across Windows, OS X and Linux with a minimum of fuss:

  • fully integrated support for the libusb/hidapi libraries
  • pre-compiled libraries provided in the JAR (no fiddling with java.library.path)
  • support for Maven and Gradle

A note on time commitment

When hid4java was first created it was because I was working on a project that required a multi-platform USB HID library. That project was mothballed in 2017 leaving hid4java on the back burner of my activities. This is a shame because it was originally intended to be a general purpose library to help other developers access HID devices through an easy to use API in Java.

Seeing that the project remains in use by developers all over the world I have decided to continue maintaining hid4java as a hobby and will be dedicating roughly an evening a week (probably a Wednesday in the GMT timezone) to keeping on top of issues and releases.

I'd really appreciate it if other developers with more experience of USB than myself can help out with pull requests or perhaps testing agains a range of devices on operating systems that I don't have easy access to.

Where next?

  • Build Guide - if you're not familiar with Java or Maven
  • FAQ - Frequently asked questions
  • Examples - Using the examples to kickstart your own project
  • Troubleshooting - A comprehensive troubleshooting guide
  • Learning USB - Various useful resources for learning USB
  • Cross-compilation - Details on the cross-compilation process for hidapi