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 am trying to run the ant build file I generated from the Eclipse
From within an Eclipse plugin, I'd like to run an Ant build script. I
I can do this run ANT build.xml from Maven using ant run plugin .
I'm trying to run an ant script from eclipse but it fails with the
my build is a 3 step process. run ant to build. transfer war to
My jar will not run after I compiled it. I use this ant build
Can not run following SQL from ant's sql task : BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE( queue_table =>
I know how to run a single target in ANT, but it also checks
I am trying to schedule the following ANT build in jenkins to execute a

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.