ADDING JAR FILE BY MODIFYING CLASSPATH
In this doc i will be discussing couple of ways to modify the CLASSPATH and will be adding a jar file in the CLASSPATH.
- modifying CLASSPATH in commEnv.sh
let’s suppose you have a jar file with the name of sample.jar under /u01/domains/part1/wlsadmin/sample.jar and you would like modify CLASSPATH by adding this jar file in you current environment . Here is how you will do it.
go to the location where commEnv.sh file is and add this syntax PRE_CLASSPATH=/u01/domains/part1/wlsadmin/sample.jar in the script as shown below in the screen shot mark in red check sign. Please note if you have multiple domain on the same machine this jar file will get initiated on all the domains.
2nd: if you only want modify the CLASSPATH and add this jar to reflect in your current domain instead of all the domains in your machine. Only modify setDomainEnv.sh script of the domain that you want to modify CLASSPATH. Location of setDomainEnv.sh script is under $DOMAIN_HOME/bin directory. vi into setDomainEnv.sh file and add PRE_CLASSPATH=/u01/domains/part1/wlsadmin/sample.jar
3rd: To initiate jar file on all the servers in the domain and add it to CLASSPATH. Only thing one have to do is drop the jar file under $DOMAIN_HOME/lib folder. After placing the files you will have to restart the server and it will be picked up.