title: some basic concepts regarding JAVA and Linux: PATH variable in LINUX and class location by JVM
body: <p>I am new to Java programming and Linux environment. And I am finding it difficult to understand few things about what is classpath, how does JVM locate classes, and JAVA API and many other things.</p>
  
  <p>For example , today I wrote two simple classes 1)employee and 2) employeetest and placed them in the same folder. 
  (employeetest has the "main" method and uses employee in its code.)
  I compiled employeetest and then executed it using "javac" command.
  I saw that , employee.class was also added to the folder. So does this mean that JVM automatically compiles all those files that are required for execution?</p>
  
  <p>Then i placed the employee class outside the current directory , and then tried to execute employeetest. Now I got an error regarding <code>ClassNotFound</code>!! 
  why is it so? why didn't JVM search for the employee class in other directories?</p>
  
  <p>The directory where I placed employee is also on my classpath or "PATH" in my linux? 
  technically it should search for other directories also that are there in the PATH ? </p>
  
  <p>correct me if I am wrong, because I am reading so many things on internet, I am not able to figure these concepts out clearly?</p>
  
  <p>SO where does JVM search for the classes? In the same directory where the class with "main" is located?</p>
  
  <p>On my machine when i do echo <code>$JAVA_HOME</code> nothing prints. but still my <code>java</code> and <code>javac</code> commands execute properly? why is it so? what is the meaning of <code>$JAVA_HOME</code>? where is JDK located? what are its functions?</p>