This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant not finding jar file

 
J McCarch
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build Java 7 from the Oracle source code; in Java 7 part of the build uses Ant. The build is proceeding OK until, in the JAXP section, I get an error:

java7/jaxp/build.xml:105: Problem: failed to create task or type replaceregexp

Cause: the class org.apache.tools.ant.taskdefs.optional.ReplaceRegExp was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/root/.ant/lib
-a directory added on the command line with the -lib argument


I found a jar file with the class - ant-nodeps-1.7.1.jar.

(I am using Ant 1.7.1)


I put this in /usr/share/ant/lib, but when I rerun I continue to get the same error. I tried several tweaks to try to get it to look in the jar, to no avail.

I haven't done much with Ant before (avoid it like the plague, actually, as I despise the whole programming-by-xml concept) but I am trying to get this built. The documentation for Ant doesn't seem to say anything about how classpath is selected and googling has been largely useless.

If there are any Ant experts who can explain what the problem is here, your help would be welcome.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, adding the JAR to Ant's lib directory should have worked. Try running the Ant script with the -b or -v options and see if that gives more information.

Another thought - does the JVM source come with embedded Ant? If so, then it will be using that copy and not the one that you installed.
 
J McCarch
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I finally got around this by unjarring and combining the ant and ant-devel jars into one new ant.jar and placing it in that directory. Hope I don't need to upgrade ant anytime soon.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic