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

  • Home
  • SEARCH
  • 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 4046624
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:35:17+00:00 2026-05-20T13:35:17+00:00

I wanted to have a look which system properties are set here (and to

  • 0

I wanted to have a look which system properties are set here (and to which values), so the easiest way (if not writing a new Java program here) would be adding some lines to my ant build script:

  <target name="properties">
    <echoproperties/>
  </target>

But running ant gives my this error message:

/u/ebermann/projektoj/stackoverflow-examples/build.xml:19: Problem: failed to create task or type echoproperties
Cause: the class org.apache.tools.ant.taskdefs.optional.EchoProperties was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/usr/share/ant/lib
        -/u/ebermann/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

Okay, so I don’t panic, but wonder what to do.

I have Ant 1.7.1 here (an OpenSUSE system), and sadly no documentation for this version, and I’m not root to install either a current ant version or the documentation for the old version (I just downloaded it and it still does not say which jar file is needed here). Of the directories listed above, only /usr/share/ant/lib exists, but it contains nothing like optional.

I would want to download the necessary jar file and put it in my home directory, but where to find it? The ant download archive contains nothing like that, and I have no idea where else to search. (I did google a bit, but did not find anything.

So, can someone give me some pointers where to find the right jar file?

(I suppose the solution is quite easy, and something is just blocking my view.)


After vahapt‘s answer, I downloaded the file from the apache repository, and put it into the directory /u/ebermann/.ant/lib mentioned by the error message. Running ant properties again – the same result as above.

$ jar -tf /u/ebermann/.ant/lib/ant-nodeps-1.7.1.jar | grep 'EchoProperties.class'
org/apache/tools/ant/taskdefs/optional/EchoProperties.class

This looks like it should work – is the error message simply wrong?

If I put it directly into the CLASSPATH, it works:

$ CLASSPATH=/u/ebermann/.ant/lib/ant-nodeps-1.7.1.jar ant properties 
Buildfile: build.xml

properties:
[echoproperties] #Ant properties
[echoproperties] #Thu Mar 10 00:46:22 CET 2011
...
[echoproperties] user.name=ebermann
[echoproperties] user.timezone=

BUILD SUCCESSFUL
Total time: 0 seconds

I don’t want to change my normal CLASSPATH variable, and it should work by putting it into this directory, or did I understand something wrong?

Any ideas, or is this an ant bug?

(Also, why is this file nowhere mentioned in the ant documentation?)


Edit:

After the answer from vahapt, my ant build-file looks like this:

<project name="stackoverflow-examples" basedir=".">

  <target name="echoproperties.prepare">
    <available property="echoproperties.works"
               classname="org.apache.tools.ant.taskdefs.optional.EchoProperties"
               />
  </target>

  <target name="echoproperties.init"
          depends="echoproperties.prepare"
          unless="echoproperties.works">
    <taskdef name="echoproperties" classname="org.apache.tools.ant.taskdefs.optional.EchoProperties">
      <classpath>
        <fileset dir="${user.home}/.ant/lib">
          <include name="ant-nodeps.jar" />
        </fileset>
      </classpath>
    </taskdef>
  </target>


  <target name="properties" depends="echoproperties.init">
    <echoproperties/>
  </target>

</project>

This re-registers the task only if it is not already in the ant classpath. (Thus it should also work for complete ant installations which do not have this file in the home directory).

I would still say that This is not a bug; it is a configuration problem is not totally right, even more as putting the file in the indicated directory does not help.


One more interesting observation: The nodeps.jar in ${user.home}/.ant/lib (i.e. now /u/ebermann/.ant/lib/ant-nodeps.jar) is already in the class path (the one shown by ${java.class.path}, but this seems not to help for <echoproperties> to work without this taskdef.

So, this works too:

  <target name="echoproperties.init"
          depends="echoproperties.prepare"
          unless="echoproperties.works">
    <taskdef name="echoproperties"
             classname="org.apache.tools.ant.taskdefs.optional.EchoProperties"
             classpath="${java.class.path}" />
  </target>
  • 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-20T13:35:17+00:00Added an answer on May 20, 2026 at 1:35 pm

    When you make a google search, results point to ant-nodeps-1.7.1.jar
    Make sure that jar exists and you’ve added it into the classpath

    For the second part of your question:
    SOLUTION 1. You do not need to modify your CLASSPATH variable. Instead you might add it by adding the parameter -cp [JAR FILE LOCATION] (-cp is for “java” executable)
    SOLUTION 2. Jar files are simply zip files, open ant-nodeps.jar copy its content to ant.jar throw away ant-nodeps.jar
    SOLUTION 3. See the sample below. taskdef is a ant feature that loads a jar or a class into ClassLoader hierarchy. (You load the class before using it, works like a charm)

    <?xml version="1.0" encoding="ASCII"?>
    <project name="Test" default="properties" basedir=".">
    
        <target name="properties" depends="init">
            <echoproperties/>
        </target>
    
        <target name="init">
            <taskdef name="echoproperties" classname="org.apache.tools.ant.taskdefs.optional.EchoProperties">
                <classpath>
                    <fileset dir="${ant.library.dir}">
                        <include name="ant-nodeps.jar" />
                    </fileset>
                </classpath>
            </taskdef>
        </target>
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ruby is preinstalled on my Mac and so I wanted to have a look
hi I wanted to have some keys and values filtered out when compared with
I have a table setup the following way `id` int(11) NOT NULL AUTO_INCREMENT, `eventid`
I have a form on my Java application which basically is to provide the
I'm starting to have a look at Silverlight, and I wanted to start small.
Recently I got a client that wanted to have new features and a different
I have a program for which I wanted to understand the state the stack
I wanted to have a look at source code of basic networking services like
I have a wordpress website which suddenly stopped working today. When I look at
I have wanted to try GAE since launch, but coming from ASP .NET and

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.