Fork me on GitHub

What is usb4java?

usb4java is a Java library to access USB devices. It is based on the native libusb 1.0 library and uses Java NIO buffers for data exchange between libusb and Java. usb4java also supports the javax-usb standard (JSR-80) through the usb4java-javax extension.

Supported platforms are Linux (x86 32/64 bit, ARM 32/64 bit), OS X (x86 64 bit) and Windows (x86 32/64 bit). But other platforms may work as well (as long as they have at least Java 6 and are supported by libusb) by compiling the JNI library manually.

Download

Maven

When you are using Maven then you can add the necessary dependencies like this:

<-- For using just usb4java without javax-usb -->
<dependencies>
  <dependency>
    <groupId>org.usb4java</groupId>
    <artifactId>usb4java</artifactId>
    <version>1.3.0</version>
  </dependency>
</dependencies>

<-- For using usb4java with javax-usb -->
<dependencies>
  <dependency>
    <groupId>org.usb4java</groupId>
    <artifactId>usb4java-javax</artifactId>
    <version>1.3.0</version>
  </dependency>
</dependencies>

License

Copyright (C) 2011 Klaus Reimer, k@ailis.de
Copyright (C) 2013 Luca Longinotti, l@longi.li

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Getting started

Read the quick start guide and the FAQ. There are also some low-level (libusb) examples and high-level (javax-usb) examples available.

Support

For questions and discussions please use the usb4java mailing list (Google group). You can subscribe to it via email by sending a mail to usb4java+subscribe@googlegroups.com.

If you have found a bug in the software or this web site (even if it's just a typo) then please create an issue on GitHub.