Yes, you read it right, there was a jail especially for students in Heidelberg.

From 1778 to 1914, students of the university were detained at the Studentenkarzer for minor offences. They might be kept there for a day or a few weeks, depending on their offences. Many students were sentenced there for “disturbing the peace”, so if you were a student in Heidelberg during those years and dared to laugh loudly at night, you might be sent there!
The Studentenkarzer was, however, a lot less strict than normal jails. “Prisoners” could still go to lectures, and even have beers and order food from outside as long as they paid. Apparently, they were also allowed to draw and carve things onto the desks, doors, walls and ceilings, as we can still see their work today.
Back when Mark Twain was in Heidelberg, the Karzer was still running and he found out students could even choose when to go to prison at their convenience:
…an American student said that for some time he had been under sentence for a slight breach of the peace and had promised the constable that he would presently find an unoccupied day and betake himself to prison. I asked the young gentleman to do me the kindness to go to jail as soon as he conveniently could, so that I might try to get in there and visit him, and see what college captivity was like.
– Mark Twain, A Tramp Abroad

It has been more than a century since the student jail was in use, yet we can still see what the prisoners have left here: their names, offences, duration of imprisonment, as well as their own portraits in profile and random drawings created with ink, candle-smoke or chalks.
Some students back then even found it essential to be locked up in this prison at least once in their college life, as though it was a rite of passage.
This Studentenkarzer is truly unique in Germany (or in the whole world for that matter) and it’s definitely worth visiting! Ticket also includes a visit to the Old University’s Alte Aula (old lecture hall) and museum, which I highly recommend if you want to learn more about the oldest German university’s history!

Click to read: A Tramp Abroad, by Mark Twain (Appendix C: the college prison)