properties - CLASSPATH vs java.ext.dirs -
is there reason why favor using (possibly long) classpath
variable set jars should on classpath durign application run use java 1.5+ property -djava.ext.dirs
specifies whole directory(directories) of jars searched?
to make real-life example have standalone java application lib
folder containig dependent jars. sofar start script setting (maybe 20) jars classpath variable 1 one. since application archive generated maven can't see in advance jar names (e.g. change version of jar). of course can go through lib
dir in startup script , add jars found there classpath
variable again. or make maven generate script me. here comes quiestions:
1) ok , appropriate replace of setting java.ext.dirs
property contain contains + lib
dir in script? caveats hidden there?
thanks replies :)
java.ext.dirs
has specific use: it's used specify extension mechanism loads classes from. used add functionality jre or other libraries (such jai). it's not meant general-purpose class-loading mechanism.
use wildcard character *
instead. introduced in java 6, many people still don't know it's possible.
Comments
Post a Comment