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 1031617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T13:57:27+00:00 2026-05-16T13:57:27+00:00

When I run my Ant build it fails with the following exception: Unexpected element

  • 0

When I run my Ant build it fails with the following exception:

Unexpected element "{}target" {antlib:org.apache.tools.ant}target

I’m using Eclipse 3.4.2.

Please let me know what I’m missing here.

  • 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-05-16T13:57:27+00:00Added an answer on May 16, 2026 at 1:57 pm

    I can reproduce this problem by putting a target outside the project element that is required in ant build files. The error indicates that there is a fault in your build file – something (a target element) in the wrong place.

    This build throws that error:

    <?xml version="1.0"?>
        <target name="wibble" />
    <project name="stack_overflow">
    </project>
    

    Whereas this does not:

    <?xml version="1.0"?>
    <project name="stack_overflow">
        <target name="wibble" />
    </project>
    

    In the full error message you should get a line number to guide you to the point in the file needing attention:

    #   line number here
    #         v
    build.xml:2: Unexpected element "{}target" {antlib:org.apache.tools.ant}target
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the FTP Ant task with maven-antrun-plugin <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>ftp</id>
I'm working on a blackberry project using eclipse and bb-ant tools. I've created a
From within an Eclipse plugin, I'd like to run an Ant build script. I
I'm trying to run my junit tests using ant. The tests are kicked off
When using an Android-generated ant build file, the file references your SDK installation via
Building our Android app from Ant fails with this error: [apply] [apply] UNEXPECTED TOP-LEVEL
The NetBeans command to run an Ant build for a project is F11 .
I'm trying to run a script that uses an ANT build but I don't
I am facing problem while GWT compilation. I am using ANT build file in
I'm inching my way to doing an Ant build on my Eclipse sources. The

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.