problem with compiling....
Have a java file which has a public and a non-public top level classes.
Here is the file named MainClass.java
public class MainClass
{
//....blah...blah..
}
/*Note: This is not public.*/
class AnotherClassInSameFile
{
//....blah...blah..
}
AnotherClassInSameFile is being used by classes outside the file as well (same package ofcourse)
When I try to compile MainClass.java using JBuilder3 with jdk1.2.2 it works fine.(We have been doing this for past two years) Now we are trying to compile the same from command prompt using javac (the same jdk1.2.2) and we get the following error.
d:\src\mypackage\MainClass.java: class mypackage\AnotherClassInSameFile is defined in MainClass.java. Because it is used outside of its source file, it should be defined in a file called "AnotherClassInSameFile.java".
Since we cannot write the non public top level class in another file, can you please suggest a way around? / explain why this is not working in javac but was working in JBuilder3 ?

