1. When classpath is used, jar command is ignored . So use "classpath" with class file and "cp" with jar file 2. NEVER FORGET TO PUT : even you use only 1 external jar. In some cases you will get compilation error if you don't put : java -classpath /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar : com.cbrc.motifmap.CombinationOfTF java -cp /media/Data/eclipseWorkspace/myExternalJar/commons-math-1.2.jar: -jar myJar.jar