About 10 years ago, I used something of that description with a Lego Mindstorms robot. The project site (looking at the Wikipedia page, we must've been using Lejos NXT) had API documentation like the Sun site did, links to their cut-down JDK, etc. I don't remember if we flashed the controller brick with a custom firmware, or if the JRE was linked into the class files produces by compilation, but it worked nicely for our purposes.
For reference, the NXT v1 brick has an ARM-based Atmel microcontroller with a clock of ~55MHz, 256KB of flash, and 64KB of RAM, along with a smaller ATMega4 microcontroller.