In this paper we partially describe JV2 M, a metaphorical simulation of the Java Virtual Machine where students can learn Java language compilation and reinforce object-oriented programming concepts. cription is contextualised within an abstract categorization of learning-by-doing tutoring systems intended to identify different activities where CBR can be applied. We concentrate on one of those activities, concretely on the automatic generation of new exercises through retrieval and adaptation of seed cases representing prototypical examples.