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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:21:03+00:00 2026-05-15T14:21:03+00:00

I’ve dealt with errors like this in Eclipse before, but I have no idea

  • 0

I’ve dealt with errors like this in Eclipse before, but I have no idea why I’m getting it this time. I have the Apache Commons IO library in my Build Path as well as in my “lib” folder.

I’ve given the error below. It’s pretty straightforward.

[javac] Compiling 3 source files to C:\Users\Justian\workspaces\ConnectionCompiler\build
[javac] C:\Users\Justian\workspaces\ConnectionCompiler\src\jab\jm\readers\ExcelReader.java:5: package org.apache.commons.io does not exist
[javac] import org.apache.commons.io.FileUtils;
[javac]                             ^
[javac] C:\Users\Justian\workspaces\ConnectionCompiler\src\jab\jm\readers\FileManager.java:5: package org.apache.commons.io does not exist
[javac] import org.apache.commons.io.FileUtils;
[javac]                             ^
[javac] C:\Users\Justian\workspaces\ConnectionCompiler\src\jab\jm\readers\FileManager.java:12: cannot find symbol
[javac] symbol  : variable FileUtils
[javac] location: class jab.jm.readers.FileManager
[javac]         return FileUtils.convertFileCollectionToFileArray(FileUtils.listFiles(
[javac]                                                           ^
[javac] C:\Users\Justian\workspaces\ConnectionCompiler\src\jab\jm\readers\FileManager.java:12: cannot find symbol
[javac] symbol  : variable FileUtils
[javac] location: class jab.jm.readers.FileManager
[javac]         return FileUtils.convertFileCollectionToFileArray(FileUtils.listFiles(
[javac]                ^
[javac] 4 errors

Why can’t it import the class? It’s even suggested that I add that specific one with Eclipse’s auto-correct.

Many thanks!

Justian

EDIT:

Oh. Sorry. Been working on multiple things at once. Of course this would be an Ant issue.

Ok. Here’s my build file. What’s interesting is that this has worked in the past. Why would it not work now?

<?xml version="1.0" ?>

<project name="ServerJar" default="dist" basedir=".">
    <description>
        Builds client files into .jar
    </description>
    <!-- [build variables] -->
    <property name="src" location="src" />
    <property name="build" location="build" />
    <property name="dist" location="dist" />

    <target name="init">
        <!-- makes time stamp to be used in jar name -->
        <tstamp />
        <!-- creates build directory structure -->
        <mkdir dir="${build}" />
    </target>

    <target name="compile" depends="init" description="Compiles the source">
        <!-- compiles the java code from ${src} into ${build} -->
        <javac srcdir="${src}" destdir="${build}" />
    </target>

    <target name="dist" depends="compile" description="Generates distributable">
        <!-- creates the distribution directory -->
        <mkdir dir="${dist}/lib" />

        <!-- puts everything in ${build} into the jar file -->
        <jar jarfile="${dist}/lib/CC-${DSTAMP}.jar" basedir="${build}">
            <manifest>
                <attribute name="Main-Class" value="jab.jm.Test" />
            </manifest>
        </jar>

        <!-- makes a jar file for quick test execution -->
        <jar jarfile="${dist}/lib/CC.jar" basedir="${build}">
            <manifest>
                <attribute name="Main-Class" value="jab.jm.Test" />
            </manifest>
        </jar>
    </target>

    <target name="clean" description="Cleans up the extra build files">
        <!-- deletes the ${build} and ${dist} directories -->
        <delete dir="${build}" />
        <delete dir="${dist}" />
    </target>
</project>

EDIT:
For anyone who has this problem in the future, here was my final build file:

<?xml version="1.0" ?>

<project name="ServerJar" default="dist" basedir=".">
    <description>
        Builds client files into .jar
    </description>
    <!-- [build variables] -->
    <property name="src" location="src" />
    <property name="build" location="build" />
    <property name="dist" location="dist" />
    <property name="lib" location="lib" />
    <!-- [path to packages] -->
    <path id="master-classpath">
        <fileset dir="${lib}">
            <include name="*.jar"/>
        </fileset>
    </path>


    <target name="init">
        <!-- makes time stamp to be used in jar name -->
        <tstamp />
        <!-- creates build directory structure -->
        <mkdir dir="${build}" />
    </target>

    <target name="compile" depends="init" description="Compiles the source">
        <!-- compiles the java code from ${src} into ${build} -->
        <!-- <javac srcdir="${src}" destdir="${build}" /> -->
        <javac destdir= "${build}">
            <src path="${src}"/>
            <classpath refid="master-classpath"/>
        </javac>
    </target>

    <target name="dist" depends="compile" description="Generates distributable">
        <!-- creates the distribution directory -->
        <mkdir dir="${dist}/lib" />

        <!-- puts everything in ${build} into the jar file -->
        <jar jarfile="${dist}/lib/CC-${DSTAMP}.jar" basedir="${build}">
            <manifest>
                <attribute name="Main-Class" value="jab.jm.Test" />
            </manifest>
        </jar>

        <!-- makes a jar file for quick test execution -->
        <jar jarfile="${dist}/lib/CC.jar" basedir="${build}">
            <manifest>
                <attribute name="Main-Class" value="jab.jm.Test" />
            </manifest>
        </jar>
    </target>

    <target name="clean" description="Cleans up the extra build files">
        <!-- deletes the ${build} and ${dist} directories -->
        <delete dir="${build}" />
        <delete dir="${dist}" />
    </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-15T14:21:04+00:00Added an answer on May 15, 2026 at 2:21 pm

    You posted output from Ant.

    Unless you are somehow integrating Eclipse with your build.xml file, Eclipse’s idea of the classpath for your project is completely separate and mutually exclusive from the classpath used to build your project in your build.xml.

    Solution: make sure your build.xml refers to the commons-io library when building your classes.


    Update: From the build.xml snippet you’ve posted, looks like you are trying to compile your classes with no classpath references whatsoever. You need to tell the javac task where to find the library references.

    Here is an example of using the javac task which refers to a classpath declared elsewhere:

    <path id="master-classpath">
        <fileset dir="${lib.dir}">
            <include name="*.jar"/>
        </fileset>
    </path>
    
    <javac destdir="${classes.build.dir}">
        <src path="${src.dir}"/>
        <classpath refid="master-classpath"/>
    </javac>
    

    This sets up an Ant “path” which refers to every file ending in .jar in the directory pointed to by the ${lib.dir} property. You can of course change this to suit your needs, if for example you only want to refer to certain named jar files or you have several different directories containing your libraries.

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

Sidebar

Ask A Question

Stats

  • Questions 439k
  • Answers 439k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer These are fonts that are appropriate for East Asian languages… May 15, 2026 at 5:02 pm
  • Editorial Team
    Editorial Team added an answer Here How you can do :: self.posterView.layer.borderColor = [[UIColor whiteColor]… May 15, 2026 at 5:02 pm
  • Editorial Team
    Editorial Team added an answer Net::Ping, but this is a dumb way to go about… May 15, 2026 at 5:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.