Thursday December 26, 2002
Ant won't delete a file - any ideas? I've been experiencing this problem for the last couple of days. Basically, when I run "ant clean" on my project, I get the following error:
file:d:/source/appfuse/build.xml:746: Unable to delete file D:\source\appfuse\dist\appfuse-common.jar
I can delete the "dist" directory in Explorer, and also using "rm -r dist" in Cygwin. Any ideas why Ant is choking on this all of a sudden? Posted in Java at Dec 26 2002, 05:05:32 PM MST 13 Comments
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
Search This Site
Recent Entries
- What's Next
- Jack's Mohawk
- LinkedIn Cuts 10% (a.k.a. The Journey is Over)
- Happy Birthday Abbie!
- Moving from Spring's XML to Annotations in AppFuse
- Free Maven Training in New Orleans on Election Day
- AppFuse Light ยป AppFuse, Maven Archetypes and Shared Web Assets
- Great Weekend in Montana
- Colorado Software Summit 2008 Wrapup
- RESTful Web Applications with Subbu Allamaraju
Posted by Erik Hatcher on December 26, 2002 at 11:02 PM MST #
Posted by Matt Raible on December 27, 2002 at 11:18 AM MST #
Posted by Chris Reeves on December 27, 2002 at 11:25 AM MST #
Posted by Matt Raible on December 27, 2002 at 11:26 AM MST #
Posted by Erik Hatcher on December 29, 2002 at 04:36 AM MST #
Posted by Yogesh on January 15, 2003 at 02:40 PM MST #
<path id="module.class.path"> <pathelement location="${lib.dir}/${generated}.jar"/> </path>Once the child build script is invoked. The ${lib.dir}/${generated}.jar is locked (may be by Ant plugin within eclipse - not sure). So next time when I try to run my main build script it complains : unable to delete ${lib.dir}/${generated}.jar. The problem was solved by keeping two copies of the $(generated}.jar one in ${base.dir} and another in ${lib.dir} and refering ${base.dir}/${generated}.jar in classpath of child build script.Posted by Yogesh on January 15, 2003 at 02:41 PM MST #
I had the same problem just with my own homemade Ant script (not an Eclipse problem or anything like that). I tried everything from file access to voodo incantations and nothing seemed to work.
Then one day as I was just about to give up and explore a new career in vetrenary psycology, it dawned on me... Ant is written in Java! That means it uses classpath. That means if my .jar file is in the classpath than Ant's JVM is probably preloading it, and if its in use, then OF COURSE you can't delete it.
<div style="background:#ffff00">Sure enough, my classpath was ".;c:\jdk;yadda yadda" I removed the ".;" and it works every time!</div>
Well, Vaya Con Dios,
-Kurt
Posted by Kurt on October 26, 2004 at 10:46 AM MDT #
Posted by Tom on February 04, 2005 at 09:01 AM MST #
Posted by Joel on February 17, 2005 at 11:07 AM MST #
Posted by Logi Helgu on September 06, 2005 at 07:18 AM MDT #
Posted by Zhao Ke on November 01, 2006 at 01:44 AM MST #
Posted by Bob P. on November 25, 2008 at 01:31 PM MST #