Eclipse unworkably slow after java-compilation error during mx-deployment

Eclipse unworkably slow after java-compilation error during deployment. Possibly a memory-leak or missing references. Editing java-source in Eclipse gets impossible: severe memory problems; after adding one single character to the source Eclipse turns 'idle' (javaw.exe consuming incredible amount of memory). Removing the damaged sourcefile and recompile didn't help. Provided a simple solution to tackle this problem though (see answer).
1 answers

Remove the corrupt java-file from the java source-folder (but keep a copy somewhere else); copy the mx-project to another folder. Delete entire project folder from Eclipse (option 'including contents' checked). Recompile the mx-project in the newly named folder. Re-import the project into Eclipse from the differently-named folder being shared with mx (option 'copy projects into work-space' should NOT be checked). Deploy the mx project (a fresh javasource template of the corrupt file will be generated) and copy the user defined code back into it. Eclipse functionality will be fully recovered.