Если вы проверите источник Glassfish, в частности ./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java, вы увидите все искажения, через которые Glassfish проходит, чтобы удалить / переименовать файлы и каталоги в Windows.
Это проблема Windows с ограничениями на удаление и переименование открытых файлов.
Там есть все виды хитростей, в том числе многократный запрос GC от JVM в надежде закрыть поток файлов, псевдо-переименование, циклы sleep-try.
Некоторые примеры:
/**
*Attempts to delete files that could not be deleted earlier and were not overwritten.
*<p>
*On Windows, the method requests garbage collection which may unlock locked
*files. (The JarFile finalizer closes the file.)
/*
*On Windows, as long as not all leftover files have been cleaned and we have not
*run the max. number of retries, try again to trigger gc and delete
*each remaining leftover file.
*/
/**
* Windows has BIG issues renaming a directory that is open somnewhere -- e.g. if
* a DOS box is opened anywhere in that directory.
* This method will try to do a "virtual renaming" if there are problems
* I.e. it attempts to do a simple rename, if that fails it will copy everything under
* the original directory to the renamed directory. Then it will delete everything
* under the original directory that the OS will allow it to.
На практике это иногда приводит к скрытому развертыванию или повторному развертыванию в Windows, поскольку некоторые файлы не могут быть удалены или перемещены и в конечном итоге остаются позади. Из примерно 50 экземпляров Glassfish, которые я запускаю, у меня никогда не было проблем с Solaris 10, и у меня всегда были проблемы, связанные с этим в Windows.
Короче говоря, любая * NIX будет лучше только по этой причине, за исключением других соображений администратора платформы.