Where should I put tomcat external libraries

configurationservletstomcat6

I'm trying to run scala applications under tomcat, and whenever I use standard java stuff, I seem okay. However, when I do things like string concatenation or sequence generation, I get weird errors for NoClassDefFound…

My first thoughts are that I'm not putting the required scala-library jar in the correct directories, or I need to do some additional configuration to make my servlet aware of the external dependency. I've tried putting scala-library.jar in both the tomcat6 "lib" directory and under ROOT/WEB-INF/lib, but neither seem to allow my servlets to use classes in the jar. What's going on?

Best Answer

Check your CLASSPATH environment variable contains the path to your scala-library.jar file, before you start tomcat.