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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:22:26+00:00 2026-05-24T23:22:26+00:00

I am trying to write a build.xml file for my project. When I run

  • 0

I am trying to write a build.xml file for my project. When I run build.xml as an Ant project, I get the following error:

D:\workspace\LogAlerter\src\com\j32bit\alerter\launcher\LogAlerter.java:9:  
error: package org.apache.log4j does not exist  
    [javadoc] import org.apache.log4j.Logger;

I have imported log4j in LogAlerter.Java. Here is my build.xml file:

<?xml version="1.0"?>
<project name="LogAlerter" default="main" basedir=".">
    <!-- Sets variables which can later be used. -->
    <!-- The value of a property is accessed via ${} -->
    <property name="src.dir"   location="src"   />
    <property name="build.dir" location="build" />
    <property name="dist.dir"  location="dist"  />
    <property name="docs.dir"  location="docs"  />
    <property name="libs.dir"  location="lib"  />

    <!--
        Create a classpath container which can be later used in the ant task
    -->
    <path id="build.classpath">
        <fileset dir="${libs.dir}">
            <include name="**/*.jar" />
        </fileset>
    </path>


    <!-- Deletes the existing build, docs and dist directory-->
    <target name="clean">
        <delete dir="${build.dir}" />
        <delete dir="${docs.dir}" />
        <delete dir="${dist.dir}" />
    </target>

    <!-- Creates the  build, docs and dist directory-->
    <target name="makedir">
        <mkdir dir="${build.dir}" />
        <mkdir dir="${docs.dir}" />
        <mkdir dir="${dist.dir}" />
    </target>

    <!-- Compiles the java code (including the usage of library for JUnit -->
    <target name="compile" depends="clean, makedir" >
        <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="build.classpath" includeantruntime="false">
        </javac>
    </target>

    <!-- Creates Javadoc -->
    <target name="docs" depends="compile">
        <javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}">
            <!-- Define which files / directory should get included, we include all -->
            <packageset dir="${src.dir}" defaultexcludes="yes">
                <include name="**" />
            </packageset>
        </javadoc>
    </target>

    <!--Creates the deployable jar file  -->
    <target name="jar" depends="compile">
        <jar destfile="${dist.dir}\LogAlerter.jar" basedir="${build.dir}">
            <manifest>
                <attribute name="Main-Class" value="LogAlerter.Main" />
            </manifest>
        </jar>
    </target>

    <target name="main" depends="compile, jar, docs">
        <description>Main target</description>
    </target>

</project>
  • 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-24T23:22:26+00:00Added an answer on May 24, 2026 at 11:22 pm

    Try adding a classpath ref to your javadoc task:

    <javadoc packagenames="src" 
             sourcepath="${src.dir}" 
             destdir="${docs.dir}"
             classpathref="build.classpath">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greeting, I'm trying to put some Beanshell script in my Ant build.xml file. I've
I am trying to write Ant scripts to build jar files for Oracle ADF
I'm trying to get Team City to build my .NET solution and run my
I am trying to write an ant script which builds our project and will
I'm trying to write an ant build script to build my group's flex app,
I am trying to write to an xml file in a certain structure and
I'm trying to write a pom.xml that will allow me to run a command
I'm trying to write an MSBuild task to build a database using FluentNhibernate mappings.
Trying to write a couple of functions that will encrypt or decrypt a file
Im trying to write a single byte at a certain location in a file.

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.