Crashing javac

Eric | April 18, 2008

As I am preparing to hold COMP 520 in Fall, I just read through Michael Schwarzbach’s excellent new version of this lecture. He has one set of exercises on name resolution containing this funny example:

public class java {
    public class lang {
        public class Object {}

Give this code to javac and it will bail on you:

mucuna /tmp $ javac
An exception has occurred in the compiler (1.6.0_05). Please file a bug at the
Java Developer Connection ( after checking
the Bug Parade for duplicates. Include your program and the following diagnostic
in your report.  Thank you.

Funny, eh?