I have an existing Java Project that runs fine by itself.
I created a new Dynamic Web Project and am using Tomcat to run the Dynamic Web Project. In Eclipse I selected the build path of the Dynamic Web Project and went to Java Build Path->Projects and selected the existing Java Project.
In my servlet I can import myPackage.myClass;
from the existing Java Project and run the servlet without issue. Yet if I use anything in that class, even a simple myClass testclass = new myClass();
I get a ClassNotFound exception.
Do I need to do anything else to make this servlet call and use this other package? Both projects are in the exact same directory.
Dir structure looks like this:
parentDir/ myPackage/ myServlet/
I tried adding the Class Folder by going to Java Build Path->Libraries->Add Class Folder...
and selecting the project folder as well, but I get an error in the dialog box saying Build path contains duplicate entry:
I've never worked with servlets before nor have I used multiple packages, so I'm unsure what I'm doing wrong or if this can even work.