Learn Java by Building Robots:
Robocode is designed to make learning Java fun whilst giving you the opportunity for some wholesale carnage. Simply build a robot and then unleash it in a battle against other robots!
2001 (current build as of October 2013 is 22.214.171.124)
Robocode was started by Matthew Nelson at IBM before becoming an open source project in 2005.
Robocode robots battle it out in an arena where the last one still trundling along takes the glory. Each robot is equipped with a canon, a radar and six-wheels. How it survives depends on how well you teach it to shoot, spot other robots, and drive in the right direction. Once the robot is in a battle, it's on its own and will act according to how it has been programmed.
When you download Robocode you will find that there are plenty of robots to battle with. Some are smarter than others and if you want to beat them all, you'll need to do plenty of tinkering to your robot. A robot can start with just a few lines of Java code and could conceivably grow to thousands.
It's best to start with a simple robot and gradually increase its efficiency by reading some strategy articles. They cover everything from avoiding walls and dodging bullets to analyzing the enemy to see where they might move next!
Once you're happy with your robot you can always take it on the road to participate in a league or tournament. You'll find that the individual robots will fall into three classifications based on their code size: NanoBots (under 250 bytes) Microbots (under 750 bytes), and MiniBots (under 1500 bytes).