I am not very new to java but, still sometimes get confused by classpath errors. I am writing some servlets, they worked fine until yesterday when I added some source file to my two packages. When I try to compile packages, compiler complains that the other package does not exist. I have used the proper package name and import statements.
Here is part of my directory structure:
WEB-INF | |-classes | |-pac | |-emp |-src | |-pac | |-emp | My classpath includes the 'classes' directory. Currently there is no class file in the class directory.
When I compile source files in the 'pac' package, it says that package 'emp' does not exist, and the same when I try to compile the 'emp' package.
Here are the commands that I used to compile: .../src/pac> javac *.java .../src/emp> javac *.java Can any body please help me to fix this problem.
[ November 12, 2004: Message edited by: Jim Smithian ]
[ November 12, 2004: Message edited by: Jim Smithian ] [ November 12, 2004: Message edited by: Jim Smithian ]
Unfortunately, your directory diagram was mangled by the message board. To keep your formatting, you can use UBB CODE tags. Feel free to go back and edit your original message by clicking on the pencil-and-paper icon at the top right of it.
With that said, I'm assuming that you mean that src and classes both contain directories called pac and emp. I'm not sure why you are getting the errors you describe. Can you please copy-and-paste your CLASSPATH here as well as the exact commands you use to compile the code? Also indicate what the current working directory is when you run these commands. These details should help us track down your problem.