what are the locations coldfusion looks for these jars
Generally, ColdFusion searches the following locations for jars:
- ColdFusion Class Path (See ColdFusion Administrator > Server Settings > Java & JVM).
- Default JVM class path
- Dynamic paths specified in
THIS.javaSettings
(CF10+ only)
what version of the jar in currently running
Usually you can identify the source jar by picking a class likely to exists all versions of that library and checking it with Class.getResource(). For that specific library, CollectionUtils would probably be a good choice, since the API says it has existed since version 1.0.
// Create instance
testClass = createObject("java", "org.apache.commons.collections.CollectionUtils").getClass();
// Convert class name to format: /path/to/TheClassName.class
className = "/"& replace( testClass.name, ".", "/", "all") &".class";
// Display location, or "null" if unknown
location = testClass.getResource( className );
writeOutput( isNull(location) ? "null" : location.toString());
The results will obviously vary, but with my ColdFusion 11 install, the above returns:
org/apache/commons/collections/CollectionUtils.class
jar:file:/c:/ColdFusion/cfusion/lib/commons-collections-3.2.1.jar!/org/apache/commons/collections/CollectionUtils.class