Pre-existing Java packages start with "java.", but users can also create their own packages. For example, I have created a package called cs220utils where I can put classes for you to use. This keeps everyone from having to copy the classes I provide, which would be a nuisance and a waste of space, and would pave the way for having numerous slightly different versions of common utilities -- usually not a good idea. Instead I'll put these utilities in a single package, you'll tell the Java system where to look for it, and then import it as needed. To access these classes you need to do the following:
export CLASSPATH=$CLASSPATH:/home/department/cpsc/cs220If there is already a line like this (export CLASSPATH=$CLASSPATH:...) in your .bashrc, just add :/home/department/cpsc/cs220 to the end of it.
This is a one-time thing. Every time you start a new shell, .bashrc gets executed and the classpath is updated.
import cs220utils.FileScanner;If in the future you want access to all of the classes in the package, just import cs220utils.*.