Including jar files in class path

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:\java\MyClasses\myclasses.jar;C:\java\MyClasses\myclassesAnother.jar utility.myapp.Cool

on Linux/Unix

java -cp /opt/thirdparty/myclasses.jar:/opt/thirdparty/myclassesAnother.jar utility.myapp.Cool

Leave a Comment