please Use Code Tags when you post a source code. It is very hard to read non-formatted and non-indented code. You can edit your message using button and then add code tags to it...
I suspect you've created your own class named "Graphics2D" in the default package, and the class file is on the class path somewhere. Search your disk for Graphics2D.java and/or Graphics2D.class, and move them off the class path.