Setting a Network location in Java ClassPath -
i trying run java program on windows machines. libraries program placed on network location - \\libs\myprog
. i can't create network drive on windows machine.
now question is, how set java classpath above lib?
i tried following:
java -cp \\libs\myprog main java -cp //libs/myprog main
but nothing worked.
if desparate , need (beware: lousy design , performance point of view), can use urlclassloader
retrieving libraries @ runtime. configure urls want load libs e.g. @ application start @ argument main class or system property , hand them on urlclassloader can retrieve classes (probably lot slower , more risky local file system access, work). have @ javadoc: urlclassloader javadoc
Comments
Post a Comment