USB discovery for Linux using java

I am new to java. I need help to detect a USB event whenever a user connects to a USB port. This should be developed for Linux OS using java. Please offer me an api that can completely fill my requirements.

early:)

+4
source share
2 answers

You can use this:

http://jusb.sourceforge.net/

Also check out this discussion:

SWT: receiving notification of a change in the system device (connecting / disconnecting a USB device)

Edit1. Do not forget that jusb is terminated. However, the full source code is available on sf.

+1
source

Java 7.0 introduces a new WatchService API. In combination with the linux command "mount", I found a working solution.

See http://arjenmaxnet.blogspot.nl/2014/01/detecting-usb-devices-with-java-70.html

0
source

Source: https://habr.com/ru/post/1446904/


All Articles