File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Unable to delete file... jar Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Unable to delete file... jar" Watch "Unable to delete file... jar" New topic
Author

Unable to delete file... jar

Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Hi there guys.
I am unable to get ant to delete or rename any jar file.
I keep getting "Unable to delete file...."
As a test, I put a jar file in a folder, and made a single ant target that must delete that file, but it can't.
Why? I'm not referencing that jar anyware else.
It's driving me nuts.
Pleas help if you can.
Thanx much.


Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
john smith
Ranch Hand

Joined: Mar 04, 2004
Posts: 75
I'm not referencing that jar anyware else.

Are you absolutely sure? Assuming you are on Windows, try searching for anything which has a handle to the jar file (using a process explorer - sysinternals.com has a good one). I bet you'll find something else has a reference to it - IDE's for example often keep an active reference to jars.
[ March 11, 2004: Message edited by: john smith ]
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Hi John.
Well, I don't know.
I check out my file name in File Monitor, and got a couple of million listings for it.
Something to note, when I give the jar a different extension, like tmp, all works fine. The very same file, it just doesn't end with .jar.
I run ant from within my IDE, JCReater 3.
I'll try running it from a command line and see what happens.
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Same thing from command prompt.
Something somehow must be referencing it, just not sure how to figure it out.
john smith
Ranch Hand

Joined: Mar 04, 2004
Posts: 75
Other common thing to watch out for are Virus Scanners (particularaly as you only seem to get this with jar files). Try and find out which PIDs are associated with the reference.
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Will check it out. Thanx John.
 
 
subject: Unable to delete file... jar
 
Threads others viewed
Javac error
unable to delete or rename old file
Problems Running Jar using ant
eclipse ant jarsigner error
Undeploy context
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture