The selected answer certainly works (which pretty much boils down to "copy everything to $instancedir/lib
") but solr configuration provides a way to separate the "standard/global" libraries that comes with solr and "extension" libraries (i.e., custom solr handlers/parsers/etc) that's specific to the instance.
there are at least two directories that solr looks into to load classes needs to load: the ${solr.install.dir}
which is pretty much where solr is installed. use the scripts (available in v4.10.x) this is set by default to the directory where bin/solr
script is run. solrconfig.xml
uses this directory as the base for loading the jars specified in the solrconfig.xml
file; it can be overriden by a java -D
parameter or overriding completely in the file itself as specified in the selected answer. this is i would think one would have to load the "global" libraries.
now, there's a 2nd solr variable ${solr.solr.home}
which is the instance home where all the index artifacts/files are created, and here we have solr.xml
. you have this directory for each solr instance (running in a different port) separately. in that solr.xml
file, you can have a sharedLib
element, which is a folder relative ${solr.solr.home}
. this is i would think any "extension" libraries specific to a solr instance will be loaded from.