This has nothing to do with J2EE, it is just basic
Java. How are you compiling your classes? Command-line?
IDE?
Assuming command-line, javac takes a -classpath argument that you can use to provide the classpath to compile with. Example:
javac -classpath .;c:\somelocation\j2ee.jar *.java