Check whether the current classpath already contains our jasper libraries and dependencies or not.

Without validating this the classpath would grow and contain duplicated references with every jasper report you print.
This commit is contained in:
deathmeat 2007-08-20 15:07:57 +00:00
parent bc451d1044
commit f445ee98c7
1 changed files with 10 additions and 5 deletions

View File

@ -815,6 +815,10 @@ public class ReportStarter implements ProcessCall {
}
if(jasperreportsAbsolutePath != null && !jasperreportsAbsolutePath.trim().equals(""))
{
// Check whether the current CLASSPATH already contains our
// jasper libraries and dependencies or not.
if(System.getProperty("java.class.path").indexOf(jasperreportsAbsolutePath) < 0)
{
System.setProperty("java.class.path",
System.getProperty("java.class.path") +
@ -823,6 +827,7 @@ public class ReportStarter implements ProcessCall {
log.info("Classpath has been corrected to " + System.getProperty("java.class.path"));
}
}
}
/**
* @author rlemeill