An update based on some recent hands-on experience ...
If the target device is a Raspberry Pi running Raspbian OS, you can use the Pi4J API and libraries for GPIO operations and communications over the serial port, I2C, and SPI. The Raspbian distribution includes a Java 8 SE runtime environment, the Pi4j libraries, and the platform-specific JNI library.
I have only tried GPIO so far and found the API functionality quite complete and easy to use. My development environment is Eclipse on Windows 7 and CentOS Linux .
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss