title: Could not find or load main class test
body: <p>I have already come across this error. I couldn't figure out today also.</p>
  
  <pre><code>   package com.example.cassandra;
  
     public class test
     {
       public static void main(String[] a)
       { 
          System.out.println("test");
       }
     }
  </code></pre>
  
  <p>This is my java file. My working directory is</p>
  
  <pre><code>  com/example/cassandra
  </code></pre>
  
  <p>Compile command is</p>
  
  <pre><code>  javac test.java
  </code></pre>
  
  <p>Changed working directory to parent directory of com</p>
  
  <pre><code>  cd ../../..
  </code></pre>
  
  <p>Run command</p>
  
  <pre><code>  java test
  </code></pre>
  
  <p>Says</p>
  
  <pre><code>  could not find or load main class test
  </code></pre>
  
  <p>Any body please explain what's the problem here?</p>