The java media framework allows you to scan for and use any video device it can find, even webcams.JMF should be part of any java2 toolkit, maybe even os/2.
You can find more information on jmf and webcams at this site java.sun.com/dev/evangcentral/totallytech/jmf.html
There should be some sample code available as well.
Not really what you are after but the sample code may contain a basic program to try.
Obviously you need the scanning part of the program first. If java cannot find the webcam then it is no use to continue.
Again I don't know if any of this works under os/2.