Click to See Complete Forum and Search --> : Class "must be defined in a file called" error


Splatt
October 6th, 2000, 11:30 AM
When compiling I get the following error:

/comm/client/MainClass.java:25: Public class comm.client.MainClass must be defined in a file called "MainClass.java".

The funny thing is that MainClass *is* defined in a file called MainClass.java, and all text has the correct case. I haven't any idea what else could be causing this error. Does anyone have any suggestions?


"There's nothing more dangerous than a resourceful idiot." ---Dilbert

Phill
October 7th, 2000, 05:05 PM
Hi
Try to right click your .java file and choose
properties, and see what the file is called.
Somtimes it can get saved as MainClass.java.txt
This has happened to me, so now when saving a
file i always put quote marks around it
"MainClass.java"
Hope this helps.
Phill

Kastagaar
October 11th, 2000, 09:02 AM
Does your MainClass class have the line

package comm.client;

?