Sunday, February 6, 2011

Jars using Class Path

CLASSPATH=.:/usr/local/fubar/Foo.jar:/home/johndoe/myclasses        export CLASSPATH
Notice that subdirectories are separated with a forward slash (/) and complete paths are separated with a colon (:). This is typical for any Unix-like operating system.   

There are no spaces before or after the = sign.   

The . at the beginning of the list includes the current directory in the class path. This is necessary for Java to be able to find .java and .class files in the current directory.   

The second "entry" refers to a jar file. Use an appropriate path and file name here.   

The last "entry" refers to the base directory where other classes can be found. Most likely, it contains other subdirectories that correspond to appropriate package names.   

CLASSPATH .:\j2sdk1.4.2_09\bin;.   

No comments:

Post a Comment