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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:42:05+00:00 2026-05-16T11:42:05+00:00

We use Ant to build a Java web application. The application will compile and

  • 0

We use Ant to build a Java web application. The application will compile and run on both Tomcat 6 and Tomcat 5.5. However, the build process is slightly different depending on which version of Tomcat you have installed: 5.5 keeps jar files that the build needs in $CATALINA_HOME/common/lib and $CATALINA_HOME/server/lib, while 6.0 keeps them all in $CATALINA_HOME/lib.

How can I set up Ant to choose the correct classpath(s) depending on a setting in build.properties? I’d be ok with even having to list the directories to be included in the classpath in a setting in build.properties, but I haven’t been able to make this work.

Any suggestions?

  • 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-16T11:42:06+00:00Added an answer on May 16, 2026 at 11:42 am

    Create 2 different path items:

    <path id="path.tomcat55">
        <fileset ... (tomcat5.5 files) />
    </path>
    
    <path id="path.tomcat6">
        <fileset ... (tomcat6 files) />
    </path>
    

    Then create separate targets for building for 55, using the tomcat55 path and another for building 6 using tomcat6.

    <target name="compile.tomcat55" depends="build">
        <echo message="Compiling for Tomcat 5.5" />
        <javac srcdir="${project.basedir}/src/test" destdir="${build.dir}" fork="true" source="1.5" classpathref="path.tomcat55" />
    </target>
    
    <target name="compile.tomcat6" depends="build">
        <echo message="Compiling for Tomcat 6" />
        <javac srcdir="${project.basedir}/src/test" destdir="${build.dir}" fork="true" source="1.5" classpathref="path.tomcat6" />
    </target>
    

    Then, just call the appropriate target.

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

Sidebar

Related Questions

My jar will not run after I compiled it. I use this ant build
I currently use Ant to build Java software. However, all development that I have
We have a Java application and a supporting Ant build.xml file, and the team
I have an Ant build file where I compile the Java source code of
I want to execute an ant build through java code. I use the following
I have a spring web application in Eclipse Helios. I use Ant for my
Im doing an ant build, the command i use is ant clean compile war
I'm trying to use the command ant build.The message says java home is not
I am trying to follow a tutorial about how to use ant to build
I use ant debug to build my project. After building with this command, my

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.