Class "must be defined in a file called" error
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
Re: Class "must be defined in a file called" error
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
Re: Class "must be defined in a file called" error
Does your MainClass class have the line
package comm.client;
?