This paper describes the use of clickers in a Java programming course. However, instead of using ordinary hardware clickers, we use software clickers, implemented in Java, that allow for much richer problem types than the traditional multiple-choice question. The problem types we introduce in this paper give students a much higher degree of freedom in solving a problem, and thus more opportunities for making mistakes. We look at mistakes as learning opportunities, and we introduce a pedagogical approach that allows students to learn from mistakes of their peers. We finish with a case study and an evaluation of our approach based on the detailed analysis of its use in two semesters of an undergraduate Java programming course.