We had the same problem for our USB sensors: there is no 100% Java solution there. You will always need code for a specific OS that is written in another language (and which has access to its own API).
The most portable solution we found was to implement a kind of gateway that would encapsulate USB data through a local TCP socket. We have 3 gateway implementations (OSX, UNIX, and Windows) that will call our own API to interact with a USB device. Java code will send / receive USB traffic through a TCP gateway. We performed some tests , and we measure that the total difference between pure C ++ code and the Java implementation is less than 10 ms (for a large 45 ms transaction), while latency is negligible (no impact) when you have an open channel.
We are writing a message explaining our decision here .
source share