2

I've been studying Java on my own for a few months now, but I've hit a bit of a snag.

Can anyone tell me how to access a device plugged into a USB port? (As far as I have been able to tell, Java has no built-in way to access USB ). Is it possible to connect ( via a socket or something ) to the installed driver on a windows7 PC and interface with the camera that way (The CCD camera has ASCOM compliant drivers installed )? Unfortunately I don't know how to access device drivers on a windows system through java yet as none of the books i'm studying with seem to touch on anything like this and I don't really know what i'm looking for in the Java API documentation :(

If someone can point me to the appropriate reading or has some examples of interfacing with device drivers in Windows7 I would appreciate it. Just for some context, I'm building a rudimentary camera control application. Thanks.

9-2-5
  • 21
  • 1
  • 2
  • *Is it possible to connect ( via a socket or something ) to the installed driver on a windows7 PC and interface with the camera that way (The CCD camera has ASCOM compliant drivers installed )?* No. That is not possible. However, [this question](http://stackoverflow.com/questions/115835/what-is-the-best-method-to-capture-images-from-a-live-video-device-for-use-by-a) (and the answers) may help you. – Elliott Frisch Jan 09 '15 at 02:50
  • That is disappointing, thanks Elliot. Would you know which language i should use if i wanted to develop a windows app which COULD utilise exiting drivers? – 9-2-5 Jan 10 '15 at 03:52

1 Answers1

1

Try using usb4java.

It is cross platfom (Linux and Windows) and it works great.

Check out their website: http://usb4java.org/

They are very active and have a very good javax USB front.

Stack Underflow
  • 2,363
  • 2
  • 26
  • 51
  • Thnaks. I did see a reference to this in another post when i was searching around, looks like this may be an option. – 9-2-5 Jan 10 '15 at 03:53
  • I tried using it but there was no way to detect when a device was plugged in. I tried the Hotplug approach and I just got the message that it was not supported. Without being able to detect the plug-in of a device, it is kind of useless. – Brian Reinhold Jan 13 '18 at 18:56
  • Wait, so how was Usb4Java able to control USB devices and such then? – Jonathan J. Pecany Nov 23 '20 at 22:52