1) Using the classpath at runtime from commandline.
java -classpath . TestJava
Here dot(.) us the current directory. If you have jar files at other directories, that case you have to include all at classpath para.
2) Or setting the classpath environment variable. It will be something like below