Tuesday, November 27, 2007

Setting the class path in UNIX

CLASSPATH=classpath1:classpath2...

Multiple path entries are separated by colons. Classpath can be either archive files or folder.To include all the Jar files in a folder/directory, include the following script to collect all the jar files from the folder and will be added to the classpath.


CP=
for i in `ls $OH/j2ee/lib/*.jar `
do
 CP=$CP:$i
done
java -cp CP yourclass

No comments:

Post a Comment

Recent Posts

Unix Commands | List all My Posts

Texts

This blog intended to share the knowledge and contribute to JAVA Community such a way that by providing samples and pointing right documents/webpages. We try to give our knowledege level best and no guarantee can be claimed on truth. Copyright and Terms of Policy refer blogspot.com