1

Eclipse is holding file handles for JAR files open. It is making Git updates challenging. I am on the latest Eclipse Kepler and recently updated (Jan 2015).

It is similar to this issue: Unlink of file failed

The only way I seem to be able to fix it is by exiting out of Eclipse completely, and doing the git reset or pull from the command line, then re-launch Eclipse. Even closing the project in Eclipse doesn't work.

I have used procexp.exe to see who is holding the file handle for the JAR open and unfortunately, it's Eclipse itself. More precisely, the javaw.exe child process of eclipse.exe. The app server is shut down.

Is there a better way to manage the project in Eclipse with EGit to avoid this problem?

Does anyone have a solution?

This is exceedingly annoying because it prevents me from using the IDE (or even just keeping the IDE open!!) when switching between branches that have different JAR file versions.

Community
  • 1
  • 1
wrschneider
  • 17,913
  • 16
  • 96
  • 176

2 Answers2

1

I have the same problem and I think I tracked it down to the Eclipse-Groovy-Plugin (or the old Groovy-Version I have to use) causing this, at least in my case.

What helped me was using the FileLeakDetector to get the stacktrace belonging to the file handle of the file that was locked. That should give you an idea of what process or plugin is causing this. This might be related to this Eclipse Bug, which also contained the suggestion to use the FileLeakDetector.

geld0r
  • 800
  • 10
  • 22
0

You most likely still have one or more programs running inside Eclipse.

The underlying JVM keeps the files open, and then git cannot replace their contents as Windows will not allow it.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347