title: Makefiles in java with multiple dirrectories and dependencies
body: <p>
  So the program that I have created in Java has grown to the point where I need to start putting code in other directories to keep it more organized. The problem that I keep running into is trying to get two classes that are dependent upon each other to compile while they are in different directories. The name of the two folders are <code>Items</code> and <code>Animals</code>. The Item folder holds various different subclasses of <code>Item</code> and <code>Animals</code> is likewise. The <code>Item</code> has an owner who is an <code>Animal</code> and the <code>Animal</code> has a list of <code>Items</code>.
  I found that in Java I can use:</p>
  
  <pre class="lang-none prettyprint-override"><code>set CLASSPATH=./Animal;./Items
  #or 
  Javac -classpath ./Animal;./Items &lt;list classes&gt;
  </code></pre>
  
  <p>so I tried to call both when <code>Player</code> only needed <code>Animal</code> and <code>Animal</code> needed <code>Items</code> and <code>Items</code> need <code>Animal</code>. The part of the make file being affected I have this:</p>
  
  <pre class="lang-none prettyprint-override"><code>Player.class: Animal.jar Items.jar
      #do Player compiling stuff
  Animal.jar: ./Animal/*.java
      set CLASSPATH=./AIEngine;./Animal;./Items;./
      javac ./Animal/*.java
      jar cvfe Animal.jar ./Animal/*.class
  
  Items.jar: ./Items/*.java
      set CLASSPATH=./AIEngine;./Animal;./Items;./
      javac ./Items/*.java
      jar cvfe Items.jar ./Items/*.class
  </code></pre>
  
  <p>But either <code>Items</code> complain that it can't find <code>Animal</code> or <code>Animal</code> complains it can't find <code>Items</code>.</p>