JasperReport requires (by default) that images be in "WEB-INF/classes/". I'd like to share images between PDFs and normal JSP pages. I'd rather not clutter up classpath with garbage image files. How do I force JR to use a different location for images?
I recommend creating the following report parameters:
"/reports/"
$P{ROOT_DIR} + "images/"
$P{ROOT_DIR} + "styles/"
$P{ROOT_DIR} + "subreports/"
$P{SUBREPORT_DIR} + "common/"
This allows the images directory to be relative to the ROOT_DIR
path. It also allows you to change ROOT_DIR
dynamically. The parameters must be declared in their relative order.
In your case, using an absolute path:
"/home/user/"
$P{ROOT_DIR} + "Pictures/"
Note that changing between operating systems, directory structures, environments (e.g., migrating to JasperReports Server from JasperReports & JSF) and so forth, can be accomplished without having to modify the report. (Well, some modifications are required for JasperReports Server.)