ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <>
Subject RE: Cannot delete file from classpath.
Date Thu, 17 Aug 2006 15:56:10 GMT

> -----Original Message-----
> From: Langanke, Frank [] 
> Sent: Thursday, 17 August 2006 9:23 PM
> To:
> Subject: Cannot delete file from classpath.
> Hi,
> I have a project A which depends on a jar from another 
> project B. The problem is that I got the jar from project B 
> in the classpath of project A; at start my clean target tries 
> to delete the jar but fails because the file is in the 
> classpath. I don't know how to update the jar (how to delete it).


If your running on windows the normal behaviour is that if you create a
classloader referencing a jar, the classloader maintains an open file
reference preventing the file from deletion.  The only way around this is to
ensure that you don't hold a reference to the file unless your actually
using it.  You can achieve this by separating your build into two distinct
projects where B is build before project A and project A references the jar
file produced by B  under an appropriate path statement.  You then need to
define project X which does the sequencing of B then A.

Cheers, Steve.

Stephen McConnell

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message