Eclipse problem - file stayed opened in editor causes problematic eclipse startup - eclipse

Worked in Eclipse.
I closed it without closing file i was working on.
On next start eclipse blocked - file inside could not be opened and
it looked like it will load an load forever
Is there a way to close file in editor before eclipse is started
or do some kind of clean so i dont have this starting problem.
thank you very much for help

Looks like the file is still being treated as opened by the OS's file system.
In this case restart your computer and everything should be ok.
EDIT: well in that case it has something to do with your eclipse induced settings (eigth user settings, but is uspect it is the lock-file). Have a look into the folder (windows explorer) whre your file is to be found. Make sure you see hidden files too. Then go into the folde .metadata and have a look into the file .lock . What is in it?

Related

How to recover a .java class in an Eclipse project?

I opened the Eclipse as usual from an installer (I downloaded the complete jBPM engine and Eclipse is included with it). I open it from a command prompt. When I opened the Eclipse I found it is empty as it is installed recently. no projects or tabs or anything.
I reopened the project I am working on and found that the main file that containing the code is empty (it is one line with hidden words). I opened the project from its location on the hard disk and I found the file is also empty but I can see that there is something on it.
I tried to open the project on Netbeans but the problem is still exist. I tried to open the file from the local history but I found nothing in the history. Unfortunately I didn't take a backup from my last work. I don't know what to do right now, if you can help it will be appreciated. I attached here a picture for the eclipse with the empty file:
If the project is already deployed in some server then you can decompile them from deployed folder(i.e : webapps folder of Tomcat)

Unable to close files in eclipse

I have recently upgraded my eclipse to Mars, and .java files that were opened in my previous version are pinned and I'm unable to close.
In the image, first three .java files: CORSFilter.java, EmailController.java, EmailServiceImpl.java are stuck or pinned. I dont see an 'x' to close when i hover on the tab. I tried opening other files such as Assignment6.java and tried close all, but they still are stuck.
It does cause a havoc for having them there, but its little bothering to look at those windows while working on completely different project.
Thanks in advance.
Closing and re-opening the project in the project explorer (and afterwards opening the files) solved it for me.
Did you shutdown eclipse last time properly?
There is probably damaged file in eclipse i recommended you to
1.reinstall it.
2.right click and try to kill tab. but the x on the tab no longer work and hidden bugs/error may happened due to damaged eclipse

How to clean window history in Eclipse

Right now I'm having this issue in Eclipse where I have an XML file open that's really big in which it almost crashes Eclipse. However this file being opened is saved in my window history, therefore I restart eclipse, it tries to open this massive file again. How do I clear the opened window history in eclipse?
I would prefer not having to clear my workspace entirely as I have mylyn data I want to keep. I've tried using Eclipse clean but this doesn't seem to do anything related to opened windows.
Your workbench information are saved in this file in your workspace:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
or depending on your eclipse version:
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
You can delete it and eclipse will recreate the file, you can also try to edit it, but it's a big file and may be hard... Deleting this file all workbench related settings are lost but your projects stays intact.
Go to Preferences and search for 'workspace'. You will see the list of workspaces that you can delete.
Some alternatives:
Move or rename the offensive file so that eclipse is unable to open it.
File->Switch Workspace->Other to load a new workspace copying your workbench layout.
Just some thoughts, my experience is closing a file and then the program means that the program will not attempt to open the file once launched again.

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.

Where does Eclipse save the list of files to open on startup?

Question: where does Eclipse store the list of files it opens on startup?
Background: Having installed a plugin into Eclipse which promptly crashed, my Eclipse workspace is in a bit of a state. When started, the building workspace task pauses indefinitely at 20%. Before I uninstall the plugin I want to give it another chance. I have a feeling that the reason Eclipse is pausing is because of a file which was opened when it crashed, which it tries to reopen on startup. If I can stop this file from opening on startup there's a chance I may be able to coax the plugin to behave. The problem is I have no idea where that list of files is persisted between runs of Eclipse.
...a second before I posted this question, I realised I could just delete the file causing the problem (duh). However, the search has frustrated me enough to want to find the answer.
In your workspace the following file contains your workbench information:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
It is possible to delete it (or edit it but that requires some fiddling around I suppose) without breaking your workspace, the file gets regenerated by Eclipse. When you delete it all workbench related settings are lost (ie all editors are closed), but your projects of that workspace stay intact.
Edit: in Eclipse 4.2 the file is
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi