You can try calling File.deleteOnExit(). On Wed, Feb 1, 2017 at 3:17 AM, Clément Guillaume <cguilla...@hotpads.com> wrote:
> Hi, > > I have a unit test, using log4j 2.8 to log to a file using a FileAppender, > that deletes the log file at the end of the test. This test works well on > linux, but fails on Windows because the java process still has a file > handle to the log file, and so the file cannot be deleted. > Any idea how to have the same behavior on the two platforms? > > Thank you. >