title: can I load user packages into eclipse to run at start up and how?
body: <p>I am new to java and to the eclipse IDE.</p>
  
  <p>I am running Eclipse </p>
  
  <p>Eclipse SDK
  Version: 3.7.1
  Build id: M20110909-1335</p>
  
  <p>On a windows Vista machine.</p>
  
  <p>I am trying to learn from the book Thinking in Java vol4.
  The author uses his own packages to reduce typing. However the author did not use Eclipse and this is where the problem commes in..</p>
  
  <p>This is an example of the code in the book.</p>
  
  <pre><code>import java.util.*;
  import static net.mindview.util.print.*;
  public class HelloWorld {
  
  
  public static void main(String[] args) {
      System.out.println("hello world");
      print("this does not work");
  }
  </code></pre>
  
  <p>this is the contents of print.Java</p>
  
  <pre><code>   //: net/mindview/util/Print.java 
     // Print methods that can be used without 
     // qualifiers, using Java SE5 static imports: 
     package net.mindview.util; 
     import java.io.*; 
  
       public class Print { 
     // Print with a newline: 
        public static void print(Object obj) { 
        System.out.println(obj); 
     } 
     // Print a newline by itself: 
     public static void print() { 
     System.out.println(); 
    } 
     // Print with no line break: 
      public static void printnb(Object obj) { 
      System.out.print(obj); 
    } 
     // The new Java SE5 printf() (from C): 
      public static PrintStream 
      printf(String format, Object... args) { 
      return System.out.printf(format, args); 
     } 
      } ///:~ 
  </code></pre>
  
  <p>The error I get the most is in the statement.</p>
  
  <pre><code>    Import static net.mindview.util.print.*;
  </code></pre>
  
  <p>On this staement the Eclipse IDE says it cannot resolve net</p>
  
  <p>also on the </p>
  
  <pre><code>     print("this does not work");
  </code></pre>
  
  <p>The Eclipse IDE says that the class print() does not exist for the class HelloWorld.</p>
  
  <p>I have been trying to get these to work, but with only limited success, The autor uses another 32 of these packages through the rest of the book.</p>
  
  <p>I have tried to add the directory to the classpath, but that seems to only work if you are using the JDK compiler. I have tried to add them as libraries and i have tried importing them into a package in a source file in the project. I have tried a few other things  but cant remember them all now.</p>
  
  <p>I have been able to make one of the files work, the print.java file I gave the listing for in this message. I did that by creating a new source folder then making a new package in that foldeer then importing the print.java file into the package. 
  But the next time I try the same thing it does not work for me.</p>
  
  <p>What I need is a way to have eclipse load all these .java files at start up so when I need them for the exercises in the book they will be there and work for me, or just an easy way to make them work everytime. </p>
  
  <p>I know I am not the only one that has had this problem I have seen other questions about it on google searches and they were also asking about the Thinking In Java book.
  I have searched this site and others and am just not having any luck.</p>
  
  <p>Any help with this or sugestions are welcome and very appreciated.</p>
  
  <p>thank you </p>
  
  <p>Ok I have tried to get this working as you said, I have started a new project and I removed the static from the import statement, I then created a new source folder, then I created a new package in the source folder. Then I imported the file system and selected the the net.mindview.util folder.</p>
  
  <p>Now the immport statement no longer gives me an error. But the the print statement does, the only way to make the print statement work is to use its fully qualified name. Here is the code.</p>
  
  <pre><code>          import  net.mindview.util.*;
         public class Hello2 {
  
  public static void main(String[] args) {
      Hello2 test = new Hello2();
      System.out.println();
      print("this dooes not work");
      net.mindview.util.Print.print("this stinks");
  
  }
  
       }
  </code></pre>
  
  <p>The Error on the print statement is:
  The method print(String) is undefined for the type Hello2</p>
  
  <p>and  if I try to run it the error I get is:
  Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
      The method print(String) is undefined for the type Hello2</p>
  
  <pre><code>at Hello2.main(Hello2.java:6)
  </code></pre>
  
  <p>The Statement::::: net.mindview.util.Print.print("this stinks") is the fully qualified print statement and it does not throw an error but it does totally defeat the purpose of the print.java file..
  If you  have any questions please ask Ill get back to you as soon as I can.</p>