The leJOS Tutorial [program Lego robots with Java]
leJOS is is just one of several available replacement firmwares (with accompanying APIs and sometimes IDEs) for the Lego Mindstorms RCX brick.
An RCX brick is large yellow Lego-style brick about 6.5 x 10 x 4.5 cm's. It contains a processor and 32kb of RAM. The RCX brick has 3 output ports for motors, 3 input ports for sensors, a speaker, four buttons and an LCD. The RCX brick is the "brain" for robots created with Lego. This brick is fully programmable in many languages, including leJOS Java.