This is only possible with the IDE (Netbeans, Eclipse, etc.).
On the command line, you must define jar exactly using jar dependencies in the -classpath option.
Note: there is a -classpath directory. It will add to your class the path to the classes and files (e.g. conf) of this directory, but it will not magically add the contents of the jar to the class path.
, java- , ( ) .
- ( ). , "java (c) -cp $CLASSPATH MyProgram"