Look at the Sun's official documentation: Setting the class path to understand your options.
A quick way would be just to include your JAR(s) after the -cp
:
on Windows
java -cp C:javaMyClassesmyclasses.jar;C:javaMyClassesmyclassesAnother.jar utility.myapp.Cool
on Linux/Unix
java -cp /opt/thirdparty/myclasses.jar:/opt/thirdparty/myclassesAnother.jar utility.myapp.Cool
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…