Ubuntu: where is the Tomcat 7 home / lib directory?



Question:

When reading manuals / tutorials on setting up JDBC with Tomcat I frequently come across references to the "Tomcat's HOME\lib" directory. E.g.:

Add the driver to your classpath, to your project, or to Tomcat's HOME\lib directory.  

Other times, reference is made to the "$CATALINA_HOME/lib" directory. E.g.:

Before you proceed, don't forget to copy the JDBC Driver's jar into $CATALINA_HOME/lib.  

I am running Tomcat 7.0.53 and am aware of the following locations:

  1. /usr/share/tomcat7
  2. /var/lib/tomcat7 (where the webapps/ directory resides)
  3. /etc/tomcat7

Of the above location only /usr/share/tomcat7 contains a lib directory with jars. Is this the "Tomcat's HOME\lib" directory? What is then, the CATALINA_HOME/lib directory?


Solution:1

Its located user /usr/share/tomcat7/lib folder. If you have used apt-get install tomcat7 command for installing your container.


Solution:2

CATALINA_HOME and Tomcat's HOME is usually the same:

CATALINA_BASE:   /usr/share/tomcat7  CATALINA_HOME:   /usr/share/tomcat7  CATALINA_TMPDIR: /usr/share/tomcat7/temp  

CATALINA_HOME/lib is therefore /usr/share/tomcat7/lib


To be sure, search for bootstrap.jar. This file is located in $CATALINA_HOME/bin/

More details here


Solution:3

libs

$ tree /usr/share/tomcat7  /usr/share/tomcat7  â"œâ"€â"€ bin  â"‚   â"œâ"€â"€ bootstrap.jar  â"‚   â"œâ"€â"€ catalina.sh  â"‚   â"œâ"€â"€ catalina-tasks.xml  â"‚   â"œâ"€â"€ configtest.sh  â"‚   â"œâ"€â"€ daemon.sh  â"‚   â"œâ"€â"€ digest.sh  â"‚   â"œâ"€â"€ setclasspath.sh  â"‚   â"œâ"€â"€ shutdown.sh  â"‚   â"œâ"€â"€ startup.sh  â"‚   â"œâ"€â"€ tomcat-juli.jar -> ../../java/tomcat-juli.jar  â"‚   â"œâ"€â"€ tool-wrapper.sh  â"‚   â""â"€â"€ version.sh  â"œâ"€â"€ defaults.md5sum  â"œâ"€â"€ defaults.template  â"œâ"€â"€ lib  â"‚   â"œâ"€â"€ annotations-api.jar -> ../../java/tomcat-annotations-api-7.0.68.jar  â"‚   â"œâ"€â"€ catalina-ant.jar -> ../../java/catalina-ant-7.0.68.jar  â"‚   â"œâ"€â"€ catalina-ha.jar -> ../../java/tomcat-catalina-ha-7.0.68.jar  â"‚   â"œâ"€â"€ catalina.jar -> ../../java/tomcat-catalina-7.0.68.jar  â"‚   â"œâ"€â"€ catalina-jmx-remote.jar -> ../../java/tomcat-catalina-jmx-remote-7.0.68.jar  â"‚   â"œâ"€â"€ catalina-tribes.jar -> ../../java/catalina-tribes-7.0.68.jar  â"‚   â"œâ"€â"€ commons-dbcp.jar -> ../../java/commons-dbcp.jar  â"‚   â"œâ"€â"€ commons-pool.jar -> ../../java/commons-pool.jar  â"‚   â"œâ"€â"€ el-api.jar -> ../../java/tomcat-el-api-2.2.jar  â"‚   â"œâ"€â"€ jasper-el.jar -> ../../java/tomcat-jasper-el-7.0.68.jar  â"‚   â"œâ"€â"€ jasper.jar -> ../../java/tomcat-jasper-7.0.68.jar  â"‚   â"œâ"€â"€ jsp-api.jar -> ../../java/tomcat-jsp-api-2.2.jar  â"‚   â"œâ"€â"€ servlet-api.jar -> ../../java/tomcat-servlet-api-3.0.jar  â"‚   â"œâ"€â"€ tomcat7-websocket.jar  â"‚   â"œâ"€â"€ tomcat-api.jar -> ../../java/tomcat-api-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-coyote.jar -> ../../java/tomcat-coyote-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-i18n-es.jar -> ../../java/tomcat-i18n-es-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-i18n-fr.jar -> ../../java/tomcat-i18n-fr-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-i18n-ja.jar -> ../../java/tomcat-i18n-ja-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-jdbc.jar -> ../../java/tomcat-jdbc-7.0.68.jar  â"‚   â"œâ"€â"€ tomcat-util.jar -> ../../java/tomcat-util-7.0.68.jar  â"‚   â""â"€â"€ websocket-api.jar  â"œâ"€â"€ logrotate.md5sum  â""â"€â"€ logrotate.template    2 directories, 38 files  

webapps

$ tree /var/lib/tomcat7/  /var/lib/tomcat7/  â"œâ"€â"€ common  â"‚   â""â"€â"€ classes  â"œâ"€â"€ conf -> /etc/tomcat7  â"œâ"€â"€ logs -> ../../log/tomcat7  â"œâ"€â"€ server  â"‚   â""â"€â"€ classes  â"œâ"€â"€ shared  â"‚   â""â"€â"€ classes  â"œâ"€â"€ webapps  â"‚   â"œâ"€â"€ ROOT  â"‚   â"‚   â"œâ"€â"€ index.html  â"‚   â"‚   â""â"€â"€ META-INF  â"‚   â"‚       â""â"€â"€ context.xml  â""â"€â"€ work -> ../../cache/tomcat7  

and config

tree /etc/tomcat7/  /etc/tomcat7/  â"œâ"€â"€ Catalina  â"‚   â""â"€â"€ localhost  â"‚       â"œâ"€â"€ docs.xml  â"‚       â"œâ"€â"€ examples.xml  â"‚       â"œâ"€â"€ host-manager.xml  â"‚       â""â"€â"€ manager.xml  â"œâ"€â"€ catalina.properties  â"œâ"€â"€ context.xml  â"œâ"€â"€ logging.properties  â"œâ"€â"€ policy.d  â"‚   â"œâ"€â"€ 01system.policy  â"‚   â"œâ"€â"€ 02debian.policy  â"‚   â"œâ"€â"€ 03catalina.policy  â"‚   â"œâ"€â"€ 04webapps.policy  â"‚   â"œâ"€â"€ 10examples.policy  â"‚   â""â"€â"€ 50local.policy  â"œâ"€â"€ server.xml  â"œâ"€â"€ tomcat-users.xml  â""â"€â"€ web.xml  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »