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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:16:08+00:00 2026-05-18T22:16:08+00:00

I have the following usecase: I have a java project (myProj) which uses a

  • 0

I have the following usecase:
I have a java project (myProj) which uses a common.jar from a different project(common). I want the javac ant task to work even if the sources of myProj have not changed if the common.jar has changed (as the sources of myProj depend of it and might be invalid now).
I have a task which copies the common.jar from a central location to the myProj lib if it has changed and I can use it to set a property whether or not to “force” compilation so that end is taken care of.
I’m not sure how (or if) I can tell the javac task to try and compile anyway? I don’t want to change myProj’s sources (or timestamps) so that the task will start.
Excerpt from the ant build.xml file:

<path id="project.class.path">  
<pathelement location... />  
...  
<fileset dir="lib" includes="**/*.jar" />  
</path>  
<target name="copyLibs" >  
<copy file="${central.loc}/common.jar" todir="lib" />  
...  
</target>  
<target name="javac" >  
<javac srcdir="src" includes="**" excludes=... >  
<classpath refid="project.class.path"/>  
</javac>  
</target>  

Thanks in advance,
Ittai

  • 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-18T22:16:09+00:00Added an answer on May 18, 2026 at 10:16 pm

    Use the delete task before javac to clean old compiled classes:

    In general java classes should not be recompiled if the API of the dependent classes haven’t changed.

    Also I would suggest using maven as it handles dependencies more gracefully.

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

Sidebar

Related Questions

I have the following use case , lot of code which was tightly coupled
I have following Code Block Which I tried to optimize in the Optimized section
Say I have the following simple java bean: class MyBean { private Date startDate;
I have the following usecase: A div with some buttons When the user clicks
I have a usecase where I want to set the value of a field
I have a relatively simple use case which is failing. Consider the following code:
I have the following snippet, which compiles fine, but when I try to run
I have the following use case, a struct with some boolean and int variables
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;

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.