You might take a look at Firmata, which was designed for doing this:
It has a Java client library, as well as many other programming languages.
You might take a look at Firmata, which was designed for doing this:
It has a Java client library, as well as many other programming languages.