title: How to use jar files without package information?
body: <p>I have a jar called "MyTools". The jar is in c:\data folder. I created a new file in the same folder called "UseTools.java". Now I would like to use some of the classes from the MyTools.jar in my UseTools.java. I tried this but it doesnt seem to work:</p>
  
  <pre><code>import MyTools.*;    
  public class UseTools
  {
    public static void main(String[] args) 
    {
      MyTools.SomeClass foo = new SomeClass();
      SomeClass.doSomething();
    }
  }
  </code></pre>
  
  <p>I tried to compile this with:</p>
  
  <pre><code>javac -cp . UseTools.java
  </code></pre>
  
  <p>and got this error message:</p>
  
  <pre><code>UseTools.java:1: package MyTools does not exist
  import MyTools.*;
  ^
  UseTools.java:7: package MyTools does not exist
          MyTools.SomeClass foo = new SomeClass()
                                       ^
  2 errors
  </code></pre>
  
  <p>I did not set the package name in any class. </p>
  
  <p>Do I have to set a package name in my jar classes?</p>