Eclipse: Workspace in use or cannot be created Error

Lot of time when I am working in Eclipse, it get crashed due to some or the other reasons. Most of the time this is because I have opened a lot of applications that I am working on and this takes a bit of memory. So finally everything just get hanged and does not have enough RAM to work on. Thus, Eclipse just get hanged and what I do is to kill the eclipse process.

But next time when you try opening the workspace it gives you error “Workspace in use or cannot be created, choose a different one.”
eclipse-workspace-launcher

eclipse-workspace-error

This is because, Eclipse creates a .lock file in the workspace and make the workspace lock. This is to avoid opening the same workspace in different eclipse process.

But when Eclipse is crashed or you kill the process to free the memory, it does not delete the .lock file in workspace folder and thus you cannot open the workspace again with eclipse.

eclipse-lock-workspace

To avoid this problem, simply locate the .lock file in your workspace folder and delete it. Please do not delete the .lock file if eclipse is already opened.

Get our Articles via Email. Enter your email address.

You may also like...

39 Comments

  1. Elliot says:

    Ahh, thank you. Although I spotted my .lock file in the metadata folder (at the root of my workspace),

  2. charmi says:

    hi.when i am opening the eclipse IDE at that time it is giving me an error message –
    ” Workspace in use or cannot be created, choose a different one “.
    when 1st time it gave me this msg i had opened a new workspace but each time i m opening IDE i have to create a new workspace.after my PC has been added to n/w it is not a;;owing me to delete any data that i had previously stored and previous workspace as well.So i made new workspace that is editable in which i had deleted the .lock file.then also it is giving me the same error.Please help meee……………….

  3. Mahesh says:

    Yes deleting .lock file resolved my issue. Thanks a lot for nice suggestion.

  4. ss says:

    Wow.Worked like a charm. Had mistakenly killed an eclipse process from terminal while its open and it was not recoverable. Thanks for the suggestion

  5. Paolo says:

    Thank-you for the hint.

  6. Ganesh Pathak says:

    Thank you .. this was useful. I thought I have sacrificed my workspace. but thanks to this article

  7. Yoni says:

    Thanks. This worked for me.

  8. Param says:

    Simply Great… I spent half day to fix this issue… :D

  9. Sriharsha says:

    I knew what to do, but didn’t know why :) You solved that for me … Thanks

  10. zwolin says:

    Kudos! You fixed my problem.

  11. Ramu Patil says:

    Hi All,

    Above information is usefull. However it did not help me in my case.

    I gave full control permission to my workpsace folder and issue got resolved.

    Details:
    1. i was facing same error when i was opening my weblogic portal workshop on windows-7
    2. after givining full control permission to my bea_home folder issue got fixed.

    Thanks,
    Ramu Patil

    • Vilhelm says:

      Fixing permissions worked for me!

  12. Oberon says:

    Good tip. I’ve needed to remotely kill a particular Eclipse session that has this specific lock.
    cd /.metadata
    fuser -k .lock

  13. Priyanka Nayak says:

    Hi..The infm you provided was really useful…But when I searched my Workspace for .lock file I didnt find it..
    So I went to System->Administration->System Monitor->Processes Tab->Killed the Eclipse and all the java processes running..
    voilà —-It worked :-)

  14. Lemzo says:

    Hello

    Worked for me. After opening eclipse again , it comes back whenever I want to save
    a modified file.
    Is there a solution for this ?

    thanks

  15. Teisma says:

    If you cant find .lock in your folder try /.metadata folder.

  16. works! says:

    thanks

  17. basant says:

    thanks,it is so helpful for me.

  18. Fede says:

    Thanks a lot!!

  19. adrian says:

    Great!! Thanks

  20. James Jithin says:

    I work on linux machine and I had to go to MyWorkspace/.meta/ location and delete the .lock file.

  21. carmel says:

    thank,
    like everyone said the file is in .metadata folder (linux)

  22. BT says:

    Wow.. worked for me.
    thanks a bunch.

  23. Sivakumar says:

    Thanks man… it worked…..
    good job….

  24. Thank you! I was scratching my head for a good 5 minutes before I googled and found this site.

  25. Ravi Mavani says:

    It gives the same error. but my workspace does not contain .lock file. what should i do now?

  26. Neha says:

    Thank You!! your solution worked!

  27. hassan says:

    I can’t delete it it says “file is open in java platform se binary” and my eclipse is closed.

  28. Arunkumar U says:

    Thankyou

  29. prahlad says:

    That was helpful. However, in my case i had to delete JAVA SE Binary process to be able to delete the LOCK file.

  30. Thanks bro.. thats works for me

  31. himanshu says:

    Truely helpful! thnxx

  32. himanshu says:

    thnxx alot

  33. himanshu says:

    thnxxx alot very helpful

  34. Ajay says:

    This reply helps me a bit,but I was not able to delete the lock file,message file is opened in Java TM environment secondary is displayed.
    So I opened task manager and end the process of Java TM.
    Then only I was able to delete the Lock file.
    Now its working for me.

    Many Thanks
    Ajay

  35. Mursaleen says:

    My issue of workspace cannot be resolved by deleting .lock file. Please help me.

  36. abhay says:

    Go to the taskbar and right click on it and then go to start task manager . Go to the process tab and select eclipse.exe and click the end process button .
    Try restarting ur eclipse .

  37. Chitransh says:

    I’d tried to delete .lock file but an error occurred that it’s already in use by some other process which was javaw.exe. I tried to end this process using task manager, forcefully in command prompt but this process doesn’t end unless I restart the computer. How to end this process?

  38. sler says:

    thank you

Leave a Reply

Your email address will not be published. Required fields are marked *