I'm not sure if such games can help to learn programming. For example, Robocode is very dynamics-based and requires knowledge of control theory (which involves partial differential equations) and decision making under uncertainty. I'm doing software development for almost 10 years and yet such games are too hard for me. These games can help you to learn "AI" but not programming. It's simpler to create your own Roboco…
But for learning the Java programming language itself? Hmm definitely not.