Eclipse - “Workspace in use or cannot be created, chose a different one.” even after I removed .lock - eclipse

I moved my workspace, moved it back, and now I get this error. The other thread on this error suggests I delete the .lock file from the .metadata folder, but it doesn't work.

Sometimes the eclipse or java process is still running, even if you don't see any UI of Eclipse anymore. It might then still hold file locks or other OS specific resource locks.
Therefore please always kill all eclipse processes (and the related java processes) before trying to use a workspace again after a crash. If you are unsure about the processes, rebooting is the safe way to do this.

You can try to launch Eclipse as Administrator. Probably you have a permissions problem

in your commandline, run eclipse as:
eclipse -clean

Related

Is there anything to prevent re-importing all projects when Eclipse crashes?

Eclipse has bugs. It crashes, it freezes. And even if it doesn't the underlying OS might have its problems too. It is a fact of life.
The problem is that every time the Eclipse was brutally terminated, I am forced to delete the .metadata/.plugins/org.eclipse.core.resources folder, otherwise Eclipse wouldn't load the workspace at all.
But when I do this, the Eclipse forgets about projects in project explorer. Re-importing it again is not that much hassle, but it gets more and more annoying the more projects I work on and the more frequently the Eclipse needs to be terminated.
Is there any way to prevent the need to re-import all projects? Firefox for example, when terminated brutally, doesn't need to loose the information about the current session, because there are addons (e.g. Session Manager) that can revive old working session.
Or maybe there is a way to automatically repair the broken data in .metadata/.plugins/org.eclipse.core.resources? (It might not be that easy, since all files are binary).
Or maybe there is a way to automate workspace importing? Running such a script will be a huge time-saver.
Things I would try in order:
Start eclipse with -clean flag: ./eclipse -clean
Delete the .lock file: workspace/.metadata/.lock
Inspect the log files: workspace/.metadata/.log
Delete the .snap file workspace/.metadata/.plugins/org.eclipse.core.resources/.snap
If you are using eclipse4, delete workbench file: workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
Delete the project .markers.snap files workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/*/.markers.snap
Edit: .snap file can be named .snap or .markers.snap depending on your eclipse version

Eclipse Kepler won't open on OS X 10.9.1

I installed Kepler on my fairly new mbp running 10.9.1. Initially this worked, but now when it won't open. Clicking on the docked icon shortcut will start eclipse, but the small loading bar gets to slightly past "loading workbench" then the whole app shuts down. Running in the terminal gives me this error:
Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: org.eclipse.ui.internal.Workbench$55
I read that others were having Java issues with eclipse on mavericks but I'm not sure that is my case, especially since it was previously running. Please help!
Solved this issue by deleting the .metadata folder, forcing eclipse to create a fresh one. Works great now.
Solution
Delete the .metadata directory will make Eclipse run again.
You can find .metadata folder at your workspace directory.
Consequences
All IDE projects structure will be reset. The projects data
will be kept at the file system.
All IDE configuration data will be reset. You'll have to create it again.
FWIW, I found that it was possible to be more surgical. The issue in my case was in the .metadata.plugins\org.eclipse.e4.workbench folder. Clearing that, I lost my UI state, but all of the projects, SVN connections, etc... weren't lost.

Eclipse IDE does not start

My computer suddenly shut down due to power failure, while I was working on an Android project using my Eclipse Indigo IDE.
Now, if I start Eclipse, only an empty message dialog (see screen shot) appears and Eclipse does not start. What can I do?
(I am using Ubuntu 12.04 LTS)
Mabe Some files found in the .metadata folder of your workspace are damaged, have you tried to launch it by specifying another workspace?
You can manually specify the workspace location on the command line, using the -data command-line argument.
If you don't want to loose a lot of time by trying to fix the problem, you can import your projects into the new workspace, reinstall the plugins that was installed before and everything will be ok. otherwise, you have to take a look on the .log file found in the .metadata folder of your old workspace, analyse the stacktrace and try to understand which plugin is corrupted and delete it manually, and this may take a lot of time, thats why i suggest you the first solution. About the .metadata folder, it is in ~old_workspace/.metadata.
check your filesystems. Maybe something got corrupted when power was lost.
Check my blog post When Eclipse Won't Start and Restoring a Corrupted Workspace in Eclipse
For me, .metadata files were damaged. Since eclipse was not opening at all, changing the workspace was not an option. I deleted following directories, and could start afresh!
.metadata
.buildpath
.project
Hope this helps you as well.
Please note that you will end up loosing all the project settings.
I know my reply is too late. Hope this helps another user.
My Ubuntu in the VMware was shutdown abnormally for some reason. When I logged back in Eclipse would not start. I fixed with the following steps:
removed .lock file in the .metadata folder in the workspace
started eclipse using command line with "-clean" argument
It started fine!!!
I tried to find the corrupted file by removing the files from ~/workspace/.metadata/ one by one until Eclipse could start.
The corrupted file was ~/workspace/.metadata/.plugins/org.eclipse.core.resources/.snap
Once the file was removed Eclipse started normally.

Eclipse Performance Maintenance

Is there a cache or something that needs be cleared periodically?
Eclipse has been running pretty badly lately, especially with regards to open files and switching between them in the editor.
Frustrated and confused.
There is nothing that you as a user need to run periodically to keep Eclipse performing. I would guess that you are seeing performance problems due to Eclipse process hitting its allowed memory ceiling. Take a look at your eclipse.ini file and update the -Xmx setting. Don't crank it up too high as that can keep your Eclipse from starting.
You can delete old configurations. This might speed up start-up time, but I'm not sure. Ignore the revert highlight on the image. What you need is the delete button that appears in later versions of Eclipse next to it. Delete everything but the current installation configuration.
To access, go to Help > About Eclipse SDK > [Installation Details] > Installation History.
Also, make sure you have projects other than the one you're working on closed. Doing this reduces the size of the in-memory Eclipse workspace model.
Also make sure projects that you are running are shutting down correctly (or manually terminate them). I have found times that a project I was testing did not end after an error and I had 10 instances of it running in Eclipse, I had to select the console and manually end it. (Closing and opening Eclipse also frees things like this up).
You can give more memory to it , modifying eclipse.ini file. For example:
-vmargs
-Xms384m
-Xmx768m
default ones 256-512m.
Look here for optimal JVM settings when running eclipse
Sometimes if you've had the workspace for a very long time eclipse would run slower, delete the old workspace and then create a new one, importing the project into it again (Make sure to check in or backup your code first).
I wouldn't really recommend tampering with the eclipse JRE runtime parameters. But if you are at liberty to update eclipse, I would recommend you update it to the latest version.
I've added some tips that could help improve the performance of eclipse in an answer to a question.

Eclipse is not loading?

Eclipse was working fine just a day ago. But today, when I click the eclipse icon, it only loads the splash screen and nothing else thereafter, I even don't get to see the splash screen which contains that 'green loading sign' at the bottom, and -- while monitoring the eclipse.exe in Windows Task Manager(just after starting eclipse) -- I saw that even after the splash screen went off the screen, the eclipse.exe process went with it, after a few seconds. Keep in mind that I did NOT see any warning or error messages because, (I'm assuming, that the loading haven't gone to a point where it is capable of sending any error message)
Hence, I tried reinstalling eclipse, by copying from INSIDE the .zip directory of the installation folder and pasting it inside the eclipse program directory. But the exact same problem persists. So, now I'm currently downloading the latest version of eclipse to retry again.
Any other Advice?
UPDATE
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
just delete the .metadata folder from workspace and reload the eclipse. It worked for me.
Hoping you have the links to the update sites for your installed plugins, my advice is to download eclipse, download your already installed plugins from their update site's and then open the new eclipse and set the workspace to your actual workspace. More far than that is to trash your time... trust me.
It turned out that the hard drive containing the workspace was partially corrupted, hence I cleaned it; following that, the workspace data was still accessible. (Though usually I still keep a backup on hand.)
Probably something went wrong with Java. Try re-installing Java run-time.
It also can mean a problem with the eclipse.ini file (like an extra space at the end of the line), or a problem with the JVM path (since the splash screen is displayed by the eclipse.exe, before loading all the eclipse Java classes).
Check that eclipse.ini file and consider my ini file as a good optimization source.
If your workspace has been corrupted your safest approach is to create a new one.
I would actually strongly suggest that you reinstall everything that might have been corrupted, to avoid as much strangeness as possible. This includes the underlying OS.
I have tried out both
(1)E:\eclipse-standard-luna-RC3-win32\eclipse -clean in run
(2)deleting .metadata folder from workspace
I do not which one worked for me.Thanks...