do i have to set the classpath everytime y so? No.
If your working directory were D:\Tomcat4.1\webapps\foo\WEB-INF\classes and you tried to compile from it but had the error you mentioned (after properly placing the Person.class file in D:\Tomcat4.1\webapps\foo\WEB-INF\classes\foo), then the problem is that your CLASSPATH doesn't include the current working directory as it should.
What's the result of running the following command?
echo %CLASSPATH%
If it's %CLASSPATH% this indicates that you don't have your CLASSPATH explicitly specified, which is fine. If this is the case, then you shouldn't have been having your initial problem.
If you want to explicitly specify your CLASSPATH for some reason, then you'll likely want to make sure it includes the current working directory, as specified by a period. For the steps to take to change your CLASSPATH environment variable, take a look at
our FAQ on how to set the CLASSPATH.
Note that if your working directory were D:\Tomcat4.1\webapps\foo\WEB-INF\classes, the following command should also have worked.
javac -classpath . -d . Employee.java