Tomcat – IntelliJ IDEA add library to Tomcat

intellij-ideatomcat

I'd like to add some libraries that would be loaded before my WebApp, something like adding the Jar to CATALINA_HOME\lib. How can I do that?

Equivalent in Eclipse:

Servers->Tomcat v6.0->Open Launch configuration->Classpath->User
Entries

The problem I'm tryint to solve is that I need to include a library that contains javax.servlet.Servlet and that one cannot be loaded if not in the Tomcat system classpath. Error log:

INFO: validateJarFile([…]\WEB-INF\lib[…].jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Best Answer

You can do that by going to your Run/Debug configuration, go to one of your tomcat configured web appication, next to the application server combobox click on configure.
In the Application servers popup, you have a list of libraries click on the + button to add the Jar of your choice.

enter image description here

Related Topic