The code you've posted is fine. I strongly suspect you've got another class called GregorianCalendar
on your classpath. I suggest you look for it and remove it. Note that Calendar.DAY_OF_MONTH
itself appears to be found correctly.
One thing you might want to try (just to see which package is at fault) is explicitly specifying the types:
java.util.GregorianCalendar d = new java.util.GregorianCalendar();
int today = d.get(java.util.Calendar.DAY_OF_MONTH);
I suspect that will work, in which case you should look for a GregorianCalendar
type in the default package.
If that's still not working, it suggests your Java installation is broken.