title: Java Packages/Library Functions
body: <p>I am trying to create a package of library functions for a main Java program but I am have some issues.</p>
  
  <p>I don't know much about about Java packages and I am going through some documentary online.</p>
  
  <p>I have created my directory as such</p>
  
  <pre><code>./Program/Program.java
  ./Program/TestFunc.java
  ./Program/classes/library/
  </code></pre>
  
  <p>The contents of TestFunc.java are</p>
  
  <pre><code>package library;
  
  public class TestFunc {
  
      public void message01() {
          System.out.println("called message01");
      }
  
      public void message02() {
          System.out.println("called message02");
      }
  
  }
  </code></pre>
  
  <p>I compiled it as I read in the documentation</p>
  
  <pre><code>javac -d ./Program/classes TestFunc.java
  </code></pre>
  
  <p>Which gives me</p>
  
  <pre><code>./Program/classes/library/TestFunc.class
  </code></pre>
  
  <p>Then I try to call it in Program.java</p>
  
  <pre><code>import library.*;
  
  public class Program {
  
      public static void main(String[] args) {
  
          System.out.println("Starting Script");
  
      }
  
  }
  </code></pre>
  
  <p>When I try to compile using</p>
  
  <pre><code>javac -d ./Program/classes Program.java
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>package library does not exist
  </code></pre>
  
  <p>Why is this?</p>