I am developing web application using Tomcat 7. It uses my MyLib.jar that is placed under webapps\MyApplication\WEB-INF\lib. This library is successfully loaded by Tomcat. The problem is with libraries that are needed by MyLib.jar (let's say A.jar and B.jar).
While creating MyLib.jar I added MANIFEST with Class-path: otherLibs\A.jar otherLibs\B.jar (which are placed under webapps\MyApplication\WEB-INF\lib\otherLibs).
What is interesting, MyLib.jar can be run from command line without any problems.
It all works for me when I copy A.jar and B.jar to \lib directory. I just don't want to put them there to keep Tomcat installation clean.
Maybe I need to specify extra class path for MyApplication? Maybe globally for Tomcat? How then? Please provide any suggestions.
EDIT: Strange. I run some additional tests. I changed classpath of MyLib.jar to "A.jar B.jar" (without otherLibs directory), put A.jar and B.jar next to MyLib.jar and now it works fine. It works for me, but could you tell me why it is not working with "otherLibs" directory?
\WEB-INF\lib
instead of creating another subfolder? – regulusclass-path
when they're located underWEB-INF\lib
. As I know in the JRE spec, libs are only searched under this folder without checking the class path. – regulus