How should I set CLASSPATH?

classpath, java

Solution

Since you are using JDK6, you can use classpath wildcards: CLASSPATH=".:/home/phoenies/jdk1.6.0_17/lib/*" will match all JARS inside lib/

Check out http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html there's a section called "Understanding class path wildcards"

Problem

I did this before: CLASSPATH=".:/home/phoenies/jdk1.6.0_17/lib/tools.jar:/home/phoenies/jdk1.6.0_17/lib/dt.jar" But today an article says I should do this: CLASSPATH=".:/home/phoenies/jdk1.6.0_17/lib" If I do so, will it search all the jar files in lib? So it's probably a shorter way?

Original source