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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:16:23+00:00 2026-05-20T00:16:23+00:00

Currently, when building our project we use: javac <various command line options> C:\project\CompilationHelper.java The

  • 0

Currently, when building our project we use:

javac <various command line options> C:\project\CompilationHelper.java

The CompilationHelper class then references our main files and through a chain of dependencies everything we need gets compiled and nothing more. The class directory is then jar’ed.

I’ve started using ant and noticed that by just building our source directory we get a larger .jar file than normal.

I realise that the best solution is to find all the unused .java files and remove them but we actually have one “main” project and one “child” project within it which uses a lot of the components of the main one and separating them is unfeasable at the moment.

Is there a way to tell ant to compile one file and all it’s dependencies rather than a directory?

Many thanks in advance,

Dave

  • 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-20T00:16:24+00:00Added an answer on May 20, 2026 at 12:16 am

    You can use your CompilationHelper method in ant, too. Just give the CompilationHelper.java to your javac task, instead the whole source directory.

    Here is an example:

    <javac srcdir="src"
           destdir="classes">
      <include name="CompilationHelper.java" />
    </javac>
    

    If all the source files are (according to their package structure) below src, and a package-less class CompilationHelper in this directory, it should work.

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

Sidebar

Related Questions

I'm currently building a project and I would like to make use of some
I'm currently working on a project that is building a java-based desktop application to
We currently build our Android (Java) projects using the built-in Eclipse build tools. Then
I'm currently building a Java app that could end up being run on many
We're currently not applying the automated building and testing of continous integration in our
I want to have our WiX installer that is currently building on a build
I'm currently building an intranet engine for a project I've got on the go
I am currently building a thin C++ wrapper around pthreads for in-house use. Windows
I am building a JavaScript SDK for our API. The API currently requires (2-legged)
I'm currently in the process of building a caching system for some of our

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.