How do you (or can you) write device drivers with Java?
Created May 4, 2012
What you can do is define a Java API which is an abstraction of the devices, and implement this API on many systems using native calls. You would be writing the device driver in a language appropriate to the target machine, and then defining Java classes which call this native code in a well-defined way.
This is what Sun have done throughout the language, with the networking, filesystem, and other components which have a common interface but different implementation on different platforms.
For a nice isolated example of how it is done, have a look at the Comm API from Sun. The different platforms available support the same Java classes, but depend upon some native code delivered with these classes.