Send commands/data between a computer and Arduino via serial.

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.