This is a must know for  all programmers you must know how to do stuff  the command line way.

  1. Write your java code and save it as .java(remember the name of the class you placed your main method in).
  2. Launch your terminal(command line program).
  3. Go to the directory where your java program is present.
  4. Type javac
  5. Your program will be compiled ,if it has no errors.
  6. Ohk,now to execute your compiled java program type java name_of_the_class_that _contains_main_method(no extensions here plzz).