title: Running Java Class which calls class from another folder
body: <p>I have in one folder /projects/A/Test.java
  with the following code:</p>
  
  <pre><code>public class Test {
  
      public static void t() {
  
          System.out.println("Hey");
  
      }
  
  }
  </code></pre>
  
  <p>and in folder#2 /projects/
  with the following code:</p>
  
  <pre><code>public class Test2 {
  
      public final static void main(String[] args) {
  
          Test t = new Test();
  
          t.t();
  
      }
  
  }
  </code></pre>
  
  <p>I compile the first one with: javac Test.java
  I compile the second one with javac Test2.java -cp ./A</p>
  
  <p>Now when I try to run Test2: java Test2, I receive an error: 
  <code>Exception in thread "main" java.lang.NoClassDefFoundError: Test</code></p>
  
  <p>How can I run Test2, which calls Test from a subfolder?</p>