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.



Tags:

19 Comments

  • Elliot wrote on 23 January, 2010, 16:11

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

  • charmi wrote on 23 August, 2010, 13:24

    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……………….

  • Mahesh wrote on 6 September, 2010, 16:16

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

  • ss wrote on 7 January, 2011, 3:53

    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

  • Paolo wrote on 3 February, 2011, 12:04

    Thank-you for the hint.

  • Ganesh Pathak wrote on 13 May, 2011, 19:52

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

  • Yoni wrote on 15 May, 2011, 13:22

    Thanks. This worked for me.

  • Param wrote on 24 May, 2011, 17:51

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

  • Sriharsha wrote on 25 May, 2011, 13:31

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

  • zwolin wrote on 26 May, 2011, 19:17

    Kudos! You fixed my problem.

  • Ramu Patil wrote on 10 July, 2011, 11:36

    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 wrote on 28 September, 2011, 14:20

      Fixing permissions worked for me!

  • Oberon wrote on 16 July, 2011, 20:09

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

  • Priyanka Nayak wrote on 6 September, 2011, 15:35

    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 :-)

  • Lemzo wrote on 26 September, 2011, 18:05

    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

  • Teisma wrote on 12 October, 2011, 17:38

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

  • works! wrote on 18 October, 2011, 18:03

    thanks

  • basant wrote on 21 October, 2011, 17:03

    thanks,it is so helpful for me.

  • Fede wrote on 8 January, 2012, 1:01

    Thanks a lot!!

Leave a Reply

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

*

Copyright © 2012 ViralPatel.net. All rights reserved.