Adding Jar Files

From OpenCms Wiki
Jump to: navigation, search

There are several ways to add jar files to opencms, to be used in your jsp code. This also works for class files.

Tomcat Common Lib folder

The simplest way is to add them to the Tomcat library (common\lib) directory, then restart Tomcat. This is good for jar files that will be used by many different webapps.

OpenCms library folder

You can also add jar files to the opencms library file, and restart Tomcat. The path would be something like tomcat\webapps\opencms\WEB-INF\lib.

In the module

Finally, if you want your module to be self-contained, you can create a lib directory in your module, and upload the jar file there. However, then you must export your module, then re-import it. This has to do with how the classpaths are configured when the modules are imported. You will probably also have to restart Tomcat again.

Once you have added your jar file to the module, you don't have to export and re-import. You can simply replace the jar file. In some cases you may also have to restart Tomcat, probably good to do this every time.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox