Missing packages at runtime (imported local library)


I wanted to use a local project as a library in a new project so I added it as a library. I selected "Project Structure" and then "Libraries" > "New Project Library" (the green plus sign) > "Java" and selected the other project's root. Now I could use the imported project classes, meaning there were no compilation errors. However, at runtime (specifically when launching Tomcat), I am getting errors saying the imported project's packages don't exist.

How can I solve this issue? How can I import a local project with IntelliJ and have it recognized at runtime as well?

1 comment
Comment actions Permalink

It's recommended to use module dependencies. Import a module, make your project depend on that module: http://www.jetbrains.com/idea/webhelp/configuring-module-dependencies-and-libraries.html .

For Tomcat you have to adjust the artifact so that the new libraries are packaged into the correct location: http://www.jetbrains.com/idea/webhelp/configuring-artifacts.html .


Please sign in to leave a comment.