IntelliJ not letting go of jar file

Answered

I have a Gradle project and randomly (more often than not), my tests run from IntelliJ will fail because Gradle reaches the "Clean stale outputs" task and tries to delete a .jar file and fails, giving me the message "Unable to delete file: C:\path\to\the.jar".  When I try to delete the .jar manually, Windows tells me the .jar file is being used by IntelliJ.

I have no idea why IntelliJ would even hold on to a .jar file, it says there are no background processes running but IntelliJ grabs the file almost right when it opens.  Tests cannot even be run from a command line since the same Gradle task needs to clean the same .jar file and IntelliJ won't let go unless I end the process.

Why is IntelliJ holding on to the .jar file?

3
2 comments

Hi, could you share the project (or a simplified sample) to reproduce the issue?

0
Avatar
Permanently deleted user

Hi Petr, sorry, I can't share the project at all and it is too large to reproduce at a smaller scale, the jars that are causing the issue are built from idl files, though there are other jars generated from idl files in the project that work fine.  It is always two specific jars in the project that can't be deleted on build because IntelliJ is using them.  I was wondering if it could be the plugins I am using causing this issue.  Please let me know if there is any specific info I can give you to help.

 

Thanks

0

Please sign in to leave a comment.