IntelliJ | Warning:Artifacts builder: Cannot delete file 'C:/path/to/file.jar'

Discussion in 'Spigot Plugin Development' started by Diamond_King099, Jun 13, 2016.

  1. Until now Eclipse has been the only Java IDE I've used, but today, for various reasons, I decided to give IntelliJ a try. So far I like it a lot better, but it's not without its flaws. I usually debug my plugins by running a localhost server, trying the plugin, make code changes, export to server plugins folder, reload and repeat. When I go to export the .jar with Build > Build Artifacts while the server is running, this message usually shows up:

    Code (Text):
    Warning:Artifacts builder: Cannot delete file 'C:/path/to/file.jar'
    Now I believe this means that it can't delete the old .jar file because the server is running and thus locking the file. Now the strange part is, that despite the message, it does indeed overwrite the old file. In Eclipse it would export without any such messages.

    I Googled around but couldn't find much of a solution anywhere. Has anyone else experienced this?
  2. I had this too, but didn't really mind. Later I just exported the file to a specific folder where I now export most of my jars to and then manually copy paste
  3. Yeah that's because the JAR is in use by another process. Just press the green button with two arrows at the top left of the build log and it'll replace it.
  4. Ok, I just find it strange that it works despite the message and that it didn't happen with Eclipse.