0

In Eclipse, if you want to reorganize your filesystem, you cannot just move your Eclipse project's files on the filesystem. Instead you right-click your project in Package Explorer -> Refactor -> Move, and select the new path (which I learned from this answer).

However upon attempting this move with the Minecraft Forge Eclipse workspace project, I get a "Move Problems" error dialogue with the error message

Could not move /MDKExample

Could not move C:\Users\user\forge-1.8.11.14-mdk

Could not read from source when writing file C:\Users\user\forge-1.8.11.14-mdk\eclipse\.metadata\.lock

The process cannot access the file because another process has locked a portion of the file

After clicking through the dialogue, the source and destination of the moves are both left in an unusable state due to the half-completed move of files. Downloading fresh copy and rebuilding the Eclipse workspace with gradlew setupDecompWorkspace && gradlew eclipse (instructions), the move fails every time. What is the secret to moving a project in Eclipse?

It's a Java project, and I'm using Eclipse Mars.1 (4.5.1) on Windows 10 with Java 8. Creating a blank Java project and adding a few files, Refactor -> Move works fine, so is this problem something particular to this Eclipse Java project?

Community
  • 1
  • 1
ziggurism
  • 2,264
  • 2
  • 16
  • 23
  • .lock is something which is created by eclipse to lock workspace to ensure no other eclipse instance is running on same workspace, whereas in your case seems like other directories might be locked by some other processes. If its important for you, can you try manually moving your directories (after shutting down eclipse) and see if that works for you. – Soman Dubey Jan 03 '16 at 03:17
  • @SomanDubey I check that no other processes were using the file. I check that I had no windows open anywhere in the eclipse project directory. And I confirmed that I cannot move the file manually outside of eclipse (while eclipse is running; after exiting eclipse, there is no lock and I can move the .metadata/.lock file from command line). Using the Windows program Process Explorer function to "Find Handle or DLL" (see http://superuser.com/q/117902/302319), I search for .lock and I see only the eclipse process itself. Is eclipse blocking its own move? Is it a bug in eclipse? – ziggurism Jan 03 '16 at 22:19

0 Answers0