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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:05:59+00:00 2026-05-15T01:05:59+00:00

My ant build script starts with a java task that uses fork=true <java fork=true

  • 0

My ant build script starts with a java task that uses fork=true

<java fork="true"
  classname="org.apache.tools.ant.launch.Launcher"
  jvm="${java.home}/bin/java"
  classpathref="class.path">
  <arg value="-f" />
  <arg value="${ant.file}" />
  <arg value="generate" />
</java>

The <arg value="generate" /> points to another task in the same ant build file.
This task starts another target with a subant task that points to another file.

<subant verbose="true" target="replace">
  <fileset dir="${basedir}" includes="refactor.xml" />
</subant>

This file refactor.xml starts a java task again with fork=true.

<java classpathref="class.path"
  classname="namespace.Tool"
  fork="true"/>

The strange behaviour is: everything works fine, except once in a while I get the NoClassDefFoundError error for the namespace.Tool java source file.
After e.g. closing, reopening the file the error may disappear, however there is no reproducible behaviour.

I tried avoiding the subant construction (used to unclutter) but this doesn’t help.

Finally the class.path that is referenced is like this:

<path id="class.path">
  <pathelement location="../common/bin" />
  <pathelement location="./bin" />
  <fileset dir="${build.dir}">
    <include name="...jar" />
  </fileset>
</path>

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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-15T01:06:00+00:00Added an answer on May 15, 2026 at 1:06 am

    Cause was <pathelement location="./bin" />.

    This bin folder was recompiled by Eclipse as soon as in other steps in the sequence of Ant tasks e.g. a folder was deleted. The default setting in Eclipse is to recompile all code at such a moment.

    As a result the Ant process may or may not find a specific class in this bin folder resulting in the inconsistent NoClassDefFoundError.

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

Sidebar

Related Questions

My ANT build script uses a WebSphere command called createEJBStubs that produces a JAR
I have a Java project that I build using an Ant script. I am
I have an ant build script that needs to pull files down from a
I've created a Java project from existing source with an Ant build script in
I want to integrate an Ant script with the Java build process in Eclipse.
I'm working on a Java web project that uses Maven to build its artifacts.
I've just implemented build and deploy process which consists of java files, ant script
I am trying to run an ant build script that compiles GWT. This script
In an ant build script, how can I delete all *.java files in one
I have an ant build script that errors out with the following message. javac

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.