How to clean window history in Eclipse - 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.

Related

Edit existing directory in eclipse

This might be a dumb question, but I have a project I am trying to edit a few files for and using eclipse 4.20.0 as an IDE.
When I try to import the directory in eclipse, it creates a completely separate eclipse workspace directory and stores the files in there for my editing. (When I make changes, files in the eclipse workspace directory are changed, but not the original directory)
Is there a way to open the original directory in Eclipse and edit files directly in there? Or am I going to have to work inside the directory eclipse created and then manually move the files over every time to test them again?
I swear I've done this before, but it's been a few years so I might just be importing the directory wrong.
If you are only making a couple changes, just clicking on the .java class you need in your explorer and "Open With... -> Eclipse IDE" will allow you to edit the specific file without opening up a new project. If you are trying to open the project and work on all the files at once, File > Open Projects from File System usually works pretty well on eclipse. If you are opening another eclipse project, just click on the folder where the .project is stored when opening, not necessarily clicking into the folder itself.

Eclipse - files open with no tab title or and empty content window

I just installed Eclipse on a computer and it has been working fine for the past few days. However it suddenly stopped working this morning.
When I double click a file in the File Explorer to open it, nothing happens - a new tab is opened, but the tab has no title, just a button to close the tab. The "contents" of the tab is just a light blue screen, with no text.
I have tried the following procedures, with no success:
Right click > Open with > various Eclipse editor
Reset perspective (I am in Java EE perspective)
Change perspective to Java
Opening different file formats (.java, .properties, .xml, etc)
F3 and Ctrl-Shift-T
Creating a new project and opening a file from there
Restarting, cleaning workspace
When I open a different workspace, the files open as usual, but I still want to use my old workspace.
I am using Eclipse JEE Oxygen.
Doing a re-install fixed the problem.
Try to create a new workspace and put all your projects there from the old one.
If it does not work, it's likely that there is an error in one of the projects, try to find it, delete the project from the new workspace 1 and try to open the file, repeat it until the file opens, if you make a mistake in 1 of the projects, then you can create new classes. and copy there codes from the old ones.
P. S. If nothing works, you can download INTELIJ and open your workspace there (generally Intelij is more comfortable than Eclipse in my opinion)

Sublime Text 2 edited file-changes does not show when refreshing browser in Maven project

I am having problems when editing template-files(HTML-files) in my Maven-project. I have made the Maven-project an Eclipse-project with the command "mvn eclipse:eclipse" (if it matters). I am using the Apache Velocity Engine as template engine for this project.
The problem arises when I'm editing the files in Sublime, and then save the file and refresh the browser. The changes does not show! If I however open the template file in Eclipse, just open it, I can even just open and close it right away, and THEN refresh the browser, the changes will show.
I have done a test to see if this problem occurs on other simple projects as well, and with a single HTML-file and a simple http-server, the work I save in Sublime shows as normal.
Does anybody know what is happening here? Am I bound to keep on using Eclipse as a HTML-editor? :( Does the Eclipse project files prevent me from using other editors? Why are the changes only showing when I open the files in Eclipse?
Any help is greatly appreciated!
In order for the changes to take place you have to right-click the file in Eclipse explorer tab and choose "refresh" in order for the (static) changes to be reloaded to Apache. For dynamic changes you'll need to restart apache or use a plugin such as JRebel.
Eclipse copies the files to the "target"-folder in the webapp. Sublime(and others) does not do this automatically, so you need to do this manually, or by a plug-in that will copy the files on save.

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

Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8

After upgrading to the newest GWT/Google app engine I have problems opening my workspace in Eclipse. On startup, Eclipse hangs almost immediately and needs to be closed. This happens only in the workspace where I use GWT with app engine, and I weren't able to consistently reproduce it - sometimes it starts normally, and sometimes I need to kill the proces and restart it. There is nothing in Eclipse error log. Eclipse version is Galileo, running on Windows 7 RC.
Anyone else had similar problems? I googled but Google is not my friend today.
EDIT: Still happens after upgrading to GWT 2.0.1.
I got frustrated with not being able to open my workspace today, and finally solved this by importing projects into a new clean workspace.
Create new workspace and open it in Eclipse (to create .metadata folder).
Close Eclipse.
Manually copy all settings from old workspace (the most important settings are stored in the .metadata/.plugins/org.eclipse.core.runtime/.settings directory). Alternatively, you could use File / Export / General / Preferences in Eclipse, and then File / Import them, but I wasn't able to open workspace to do that.
Open the new workspace.
File / Import / General / Existing projects into workspace. Select root folder of your old workspace, and take care to check "Copy project into workspace".
Restart Eclipse and check that everything in the new workspace is working as it should.
Delete your old workspace.
EDIT: Another, and a bit better workaround which apparently works:
Close Eclipse.
Temporary move offending project somewhere out of the workspace.
Start Eclipse, wait for workspace to load (it should).
Close Eclipse again.
Move the project back to workspace.
I used "eclipse -refresh". Apparently it hangs on refresh something, the lower right corner tells you, what it's doing. For me it was refreshing the gwt runtime in a specific project, maybe trying to find an update or something. If you don't want to reimport your whole workspace, try -refresh or move this project temporarily out of the way.
I just deleted the state.dat file in the GWT project metadata, which seemed to remove the blocking and then triggered a recompilation.
<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<GWT project>/org.eclipse.jdt.core/state.dat
This probably won't serve as a general solution, but it worked for me and it's a lot quicker than having to copy whole projects. Maybe another file will have the same effect. I think the trick is just to "damage" the GWT project metadata enough to have it rebuilt.