Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:40:38+00:00 2026-06-01T12:40:38+00:00

i got a problem by executing groovy from an ant file. In Eclipse with

  • 0

i got a problem by executing groovy from an ant file.

In Eclipse with a launcher, everything works fine but wehn i run the ant file i got the following output:

Main.groovy: 71: unable to resolve class InitializeDatabase
[groovyc] @ line 71, column 40. [groovyc] java.lang.Object
javaClassInstance = new InitializeDatabase()
[groovyc]

[groovyc] 1 error

InitializeDatabase is a java class in the same package..

public class InitializeDatabase {

    public void test() {
        System.out.println("Hello Groovy");
    }
}

I guess the problem is located at the ant file:

<project name="tp" basedir="." default="dbsetup">
    <target name="dbsetup">
        <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
            <classpath>
                <fileset dir="../files/lib/default" includes="*.jar" />
            </classpath>
        </taskdef>
        
        <delete dir="bin" />
        <mkdir dir="bin" />
        <groovyc srcdir="src" destdir="bin" />
        
        <java classname="groovy.ui.GroovyMain" dir="../.." fork="true" failonerror="true">
            <classpath>
                <fileset dir="../files/lib/default" includes="*.jar"/>
                <pathelement location="bin"/>
            </classpath>
            <arg line="build/scripts/src/build/Main.groovy" />
        </java>
    </target>
            
</project>

Can someone help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:40:40+00:00Added an answer on June 1, 2026 at 12:40 pm

    You need to include the javac task inside your groovyc one. Change:

        <groovyc srcdir="src" destdir="bin" />
    

    to

        <groovyc srcdir="src" destdir="build">
            <javac/>
        </groovyc>
    

    And it should work fine. As it says here:

    Joint compilation means that the Groovy compilation will parse the
    Groovy source files, create stubs for all of them, invoke the Java
    compiler to compile the stubs along with Java sources, and then
    continue compilation in the normal Groovy compiler way. This allows
    mixing of Java and Groovy files without constraint.

    …

    The right way of working is, of course, to use a nested tag and all
    the attributes and further nested tags as required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got a Grails 2 app and executing run-app works fine, run-war fails: 2011-12-24 12:43:40,996
I've got a bit of a problem with some jquery. The code works fine,
The following Groovy commands illustrate my problem. First of all, this works ( as
I got a problem with IO not executing in order, even inside a do
I've got a problem with executing a python script in different environments with different
I got a stack trace from Oracle saying there was a problem on Line
I'm implementing the in-app purchase. And I got the problem while executing the delegate
I've got a problem in an Oracle function execution. I've a table loginfo(username,password,type) and
i got problem with my code and hopefully someone able to figure it out.
I got problem with sending data in Android using httpPost. I found some example,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.