just delete the
.lock file in the
.metadata directory in your eclipse workspace directory.
precaution - if you delete the
.metadata folder all preference will be deleted.
the answer @boris gave is correct 99% of the time, however it can also happen if you open the workspace in an older version of eclipse. a workspace imported into/created with juno will throw this error when opened in galileo.
another all-too-common reason for this problem is if you attempt to load a directory on a drive that is no longer connected. for example, say you program in c:\code\java, but occasionally work off of a flash drive, h:\code\java. if you do not have the drive connected it can be easy to believe you are trying to load a valid directory without noticing your typo.
another problem is when eclipse doesn't have write access to your src folder. change the security permission and make sure "authenticated users" are added with all permissions checked but full control & special permissions.
i had this error after i restarted the system (after a long time. normally i just make it sleep). found out that once i mounted the drives (by clicking and opening it) where project folder is located, and relaunching eclipse, solved the issue for me.
ps: i'm an ubuntu user.
here are a few steps to solve it the no. 4 step is works for me.
- delete .log files along .metadata folder.
- check the current user permission make sure to check the full control checkbox click apply then ok.
- if you run system drive defragmentation or maintenance before you run eclipse editor sometimes original file path are not in their respective path to make sure run "previous version" time before your system maintenance of your drive where the eclipse workbench or something similar to this was saved.
- this last option is works for me. check the drive letter of your current drive where the code editor was saved. if something unusual e.g before your maintenance your drive letter is k then after defragment or maintenance. the drive letter is now l hence you should change the drive letter to its original one that is k. to do this click the ff: open control panel system & security administrative tools computer management disk management in disk mngt choose the drive example l then right click > change drive letter & path > click remove > then ok, open it again then > click add and > choose your original drive letter for that drive then click ok. if you use your computer for a long period of time do restart first to refresh everything.
choosing a "different one" is actually a pretty easy solution.
i had been running eclipse as an administrator (
sudo eclipse from the command line) because the "workspace" folder was throwing the
workspace in use or cannot be created… error (and running as administrator seemed to be the only solution that fixed it).
a coworker (working on this same issue with me) wanted to run eclipse by clicking on an icon. so when he ran eclipse, and the dialogue box came up with the choose your workspace, he just added a "2" to the end of "workspace".
this created a new folder: "workspace2". eclipse ran fine with that; and i haven’t had any of the locking problems since.
it will occur when you not closed eclipse.exe correctly.
*open task manager->end task your eclipse->now open eclipse.exe it will work.
hope its help someone.
i have observed one case when eclipse when in forced quit, or
alt-f2 xkilled in linux, an attempt to immediately open eclipse shows that error. even the metadat/.lock file is not present in that case.
however it starts working after a span of about two minutes
i don't know what's the wrong but i solved by creating a directory directly in c drive(c:\dev) instead of from my home folder (c:\users\me\dev). but i don't have to thinks about it. in my case, it is fresh eclipse unziped instance. i am not able to see .matadata folder in eclipse folder. by god grace, i solved.
the reason this was happening to me (with photon) was easily fixed by changing an eclipse general preference:
window -> preferences -> general: uncheck: "always run in background"
once you make that change, whenever you shutdown eclipse, it will no longer leave the javaw.exe process running in the background. i’m guessing this is a bug in photon (or a bug with using the amazon corretto openjdk version of java with eclipse) that will one day be fixed.
i faced the same problem, but for some reasons the
.lock file in workspace was not getting deleted. even creating a new workspace was also getting locked.
so what i did was cleaning the windows
temp folder, the
%prefetch% folder and
%temp% locations. restart the system and then it allowed to delete the
maybe it will help someone.
it seems your workspace is used in java tm, open task manager and close eclipse.exe and java tm process.
what worked in my case was restarting the system. (ubuntu 20.04)
if anyone have come here with a stm32cube related issue, which apparently is based on eclipse and has the same problem, none of the above suggestions worked for me, and here is how i fixed it, for linux, although i suppose you can find the corresponding paths in windows as well.
$home directory, go to
org.eclipse.ui.ide.prefs contains few options including the recent workspace path, and whether it will prompt you to select a workspace at the startup. either modify the path for
recent_workspaces, or enable
in my case, there was a space right before the workspace's location
c:\. i removed that space and it was enough :)
for mac users:
it could be that another instance of eclipse is running in the background. if so, use either force quit eclipse or
ps -ef |grep eclipse kill -9 pid
to all the eclipse instances, and start the new workspace
start eclipse with the option
i got the trick here and it works.
don't do this unless you know nobody can work on the same file at the same time.
please try to end task eclipse from taskbar. it works for me.
at times, if you are on windows, you may not see all the processes - or the culprit process in task manager. i had to click 'show process from all users' and there was this java.exe that i had to kill in order to get back my workspace.
another possible case if none works is to see that there is a running
java application . may be your previous open and close has left unkilled java instances.
do look for any java instance is running if there are two at least you need to kill one.but ,most of the time i kill any java running :) because that java is using the work space earlier and still will if don't kill it.
change another work space in case if you want a multiple ide to use and work on diffrent or same project , but you should import project form workspace after you open your ide.
i was faced this issue when ever the eclipse is not closed (kill eclipse process the from task manager or computer power off), i was tried below steps, it worked for me.
1) remove the file names start with ".filetable" from this folder
2) remove the log files like text files start with numeric names from this folder
3) open command prompt(cmd) navigate to this folder
type below command
eclipse clean start
deleting logs and .lock didn't work but
-clean option fixed it for me.
there is another case where the path to the workspace may not exist, e.g., if you have imported preferences from another workspace, then some imported workspace addresses may appear in your "open workspace" dialog; then if you didn't pay attention to those addresses, you would get the exact same error once you tried to open them.
running eclipse in
administrator mode fixed it for me. you can do this by [right click] -> run as administrator on the
eclipse.exe from your install dir.
i was on a working environment with win7 machine having restrictive permission. i also did remove the
.log files but that did not help. it can be a combination of all as well that made it work.
another possible cause of the “workspace in use or cannot be created, chose a different one” issue is that the real path to your workspace may have changed.
in my case, the real location of the workspace had changed, but i had used a symlink to make it look like it was in the same location. i saw errors in logs indicating that eclipse was looking at the previous "real" location, as opposed to following the symlink, and this was causing the errors.
in my case, i just moved the workspace back to its old location.
go to taskmanager(right click in the task bar) and select processess menu bar and select eclipse.exe and click endprocess
i've seen 3 other fixes so far:
- in .metadata/, rm .lock file
- if #1 doesn't work, try killing the process javaw.exe etc. then rm .lock file
- if #1 and #2 don't work, try rm .log file in .metadata/, and double check .plugin/.
- this has always worked for me: relocate .metadata/, open and close eclipse, then overwrite .metadata back
the solution boils down to cleaning up the .metadata folder.
- Eclipse says: “Workspace in use or cannot be created, chose a different one.” How do I unlock a workspace?
- How to use classes of a package in another package which is in a project created at a different eclipse workspace
- Eclipse - "Workspace in use or cannot be created, chose a different one."
- how to use eclipse workspace on different computers
- Eclipse - “Workspace in use or cannot be created, chose a different one.” even after I removed .lock
- how do I get eclipse to use a different compiler version for Java?
- How to use different line wrapping for strings and other items in Eclipse for Java
- How do i configure eclipse to make use of different version of JDK
- how to use appcfg.py for google-app-engine projects created using google's eclipse plugin?
- How would one use IDecorationContext api from Eclipse JFace
- How can I copy Eclipse classpath variables from one workspace to a new workspace?
- How to use an existing Project as a template for a new one with Eclipse (CDT)?
- How to make Maven use Eclipse workspace default JRE?
- How to use SVN and Eclipse in workspace together?
- Photran says "At least one configuration should be available. Project cannot be created." when creating a fortran project in eclipse
- How to version control an Android project on Github and use intellij and eclipse IDE by different team members?
- How to use Ivy + IvyDE in eclipse to put different jars in lib and web-inf/lib
- How to make Eclipse correctly identify which SSH key to use when you're cloning (via git import in eclipse) from two different Github accounts
- How To Use A Relative Path For The Eclipse Workspace
- How to use different versions of Eclipse in the same project and the same source base
- How to use multiple git repositories in one bndtools workspace
- How to use Different Java versions eclipse in Linux mint?
- How to add project of different workspace into the current workspace in Eclipse
- How to install an old Java version alongside the new one for use in eclipse spring?
- How do I use eclipse to build this application when it says you can use eclipse? sinch.com/tutorials/android-video-calling
- How to use multiple GitHub projects in one Eclipse project?
- Eclipse how to select needed file for debug if one source file mentions from two projects within workspace
- Can I / How can I force JBoss & Eclipse to use only one core?
- How to fix this Maven error in eclipse - "Could not calculate build plan: Plugin or one of its dependencies cannot be resolved""
- In Eclipse git, how to change the duplicate the local branch created on one source to the new source
More Query from same tag
- Publish try code in Jenkins before committing
- Including large Android Library Project inside an Android app (resulting APK size)?
- Eclipse WTP / m2eclipse - can neither clean nor publish to tomcat
- Problem in build java maven clean install CreateProcess error=206
- Eclipse C++: Project builds but does not run
- error in running android project
- Can't install ADT Plugin
- Eclipse (Luna) shows blank widgets throughout
- What's the ideal setup for a quick turnaround in Java EE development?
- How can I keep the Eclipse debugger from automatically expanding the Package Explorer into libraries on exceptions?
- Connect to SQLite Database using Eclipse (Java)
- Check if CDT is installed in Eclipse
- Eclipse - Webserver autorun
- Cygwin1.dll 'not found' when running a program written in C. How can I make Windows find it?
- Subversive SVN Connector installation fails in Eclipse Oxygen
- c++ Google Tests run twice
- Struts 2 Eclipse Class Not Found error
- Eclipse Che - How to connect an existing Eclipse installation?
- How to find my old Eclipse workspace?
- Add a package into eclipse that is notj in src directory
- Eclipse with Python - having difficult with python version being picked up for egg file creation
- Eclipse double separator from comma(,) to dot(.)
- Inline SVGs not rendering in IE9+ when served from Tomcat 7 in CentOS 6.5
- "Unfortunately <myApp> has Stopeed" after running for 45sec on Nexus4
- Eclipse-generated method parameters having unreasonable names
- eclipse try-with-resource template?
- SIP Servlet not starting in JBOSS 7.2 from Eclipse
- how to dig into this memory leak with eclipse MAT further
- Why is eclipse trying to compile files not in my build path?
- MySQL and Eclipse Error