title: Groovy unable to resolve java class
body: <p>i got a problem by executing groovy from an ant file.</p>
  <p>In Eclipse with a launcher, everything works fine but wehn i run the ant file i got the following output:</p>
  <blockquote>
  <p>Main.groovy: 71: unable to resolve class InitializeDatabase<br />
  [groovyc]  @ line 71, column 40.   [groovyc]          java.lang.Object
  javaClassInstance = new InitializeDatabase()<br />
  [groovyc]</p>
  <p>[groovyc] 1 error</p>
  </blockquote>
  <p>InitializeDatabase is a java class in the same package..</p>
  <pre><code>public class InitializeDatabase {
  
      public void test() {
          System.out.println(&quot;Hello Groovy&quot;);
      }
  }
  </code></pre>
  <p>I guess the problem is located at the ant file:</p>
  <pre><code>&lt;project name=&quot;tp&quot; basedir=&quot;.&quot; default=&quot;dbsetup&quot;&gt;
      &lt;target name=&quot;dbsetup&quot;&gt;
          &lt;taskdef name=&quot;groovyc&quot; classname=&quot;org.codehaus.groovy.ant.Groovyc&quot;&gt;
              &lt;classpath&gt;
                  &lt;fileset dir=&quot;../files/lib/default&quot; includes=&quot;*.jar&quot; /&gt;
              &lt;/classpath&gt;
          &lt;/taskdef&gt;
          
          &lt;delete dir=&quot;bin&quot; /&gt;
          &lt;mkdir dir=&quot;bin&quot; /&gt;
          &lt;groovyc srcdir=&quot;src&quot; destdir=&quot;bin&quot; /&gt;
          
          &lt;java classname=&quot;groovy.ui.GroovyMain&quot; dir=&quot;../..&quot; fork=&quot;true&quot; failonerror=&quot;true&quot;&gt;
              &lt;classpath&gt;
                  &lt;fileset dir=&quot;../files/lib/default&quot; includes=&quot;*.jar&quot;/&gt;
                  &lt;pathelement location=&quot;bin&quot;/&gt;
              &lt;/classpath&gt;
              &lt;arg line=&quot;build/scripts/src/build/Main.groovy&quot; /&gt;
          &lt;/java&gt;
      &lt;/target&gt;
              
  &lt;/project&gt;
  </code></pre>
  <p>Can someone help me please?</p>