If you're interested in creating Java code for the Lego Mindstorms, there are a few things you will need, and one of those - the Mindstorms kit - will cost you some real money.
Here's a brief list of the requirements for this effort. I'll review each of these in the next paragraphs.