USB serial is available on nearly all Arduino based boards. Further, there are serial interface Java libraries that can connect to an Arduino. If you are unfamiliar with data communications in general, take a look a the introduction to data communications article; although it does not cover serial communication, it is still a good starting.
Serial Communication in Java with Example Program Generally, communication with serial ports involves these steps (in no particular order): Searching for serial ports Connecting to the serial port Starting the input output streams Adding an event listener to listen for incoming data Disconnecting from the serial port Sending Data.
Most projects that deal with hardware and devices, needs to communicate with them using the COM port of the PC or Server. For example if there is a modem that is connected to a server via its COM port and the Java program has to read the output of the modem then the Java program has to read the COM port for any incoming data.
Java Serial Communication
The Java Communications 3.0 API is a Java extension that facilitates developing platform-independent communications applications for technologies such as Smart Cards, embedded systems, and point-of-sale devices, financial services devices, fax, modems, display terminals, and robotic equipment.
The Java Communications API (also known as javax.comm) provides applications access to RS-232 hardware (serial ports) and limited access to IEEE-1284 (parallel ports), SPP mode.
Implementations of the API are currently available for Solaris SPARC, Solaris x86, and Linux x86. Each of Oracle's available implementations works with the Sun Ray thin client product line, and include portmapping extensions to allow an administer to specify the locations of ports as well as their visibility, names, and in some cases annotated reference.
API serial features:
Enumeration of ports (administrator and user configurable port mapping)
Port configuration (baud rate, speed, stop bits, parity)
Access to EIA232 standard DTR, CD, CTS, RTS and DSR signals
Transfer of data over RS-232 ports
Hardware and software flow-control options
Receive-buffer threshold control
Asynchronous event option for notification of:
Data available on an RS-232 port
Port hardware line level changes
Port ownership changes within a single JVM
Java communications API was initially released in 1997, prior to the Java Community Process, was 'grandfathered in' to the JCP (http://www.jcp.org) without having an associated JSR (Java Specification Request).