Eclipse slow text file opening - eclipse

I have had this before and after switching computers and a long time of happy developing, I'm having it again: Eclipse taking extremely long to open simple text files.
What's happening, what's changed is:
Tomcat now requires frequent restarts / reloads even changing Javascript files
text files take at least 30 seconds to open
My environment is:
Mac OS Maverick
STS 3.4.0
Sysdeo Tomcat
Maven project nature
AspectJ capability
Android development tools
Gradle IDE
I realize that reinstalling Eclipse/STS would be an option, but in stead of taken half a day to get it just right again, I would prefer to just fix the problem. Any ideas?
Is there any way to trace where eclipse is spending its time, some kind of high level debug output?

Well, after removing *.js from the file associations, the problem seemed to go away. After that I readded it again and everything was good again. Thanks #Cristophe for pointing me in the right direction

Related

Eclipse Freezes Constantly

I've heard rumors about "Eclipse's minute of silence", but I had no idea how bad it is.
I've installed a brand new Eclipse (from a ZIP package) and only installed the JBoss tools. Now Eclipse freezes at close to each key shortcut, but at least once every 30 seconds. Ctrl+C? One minute Freeze. Doesn't copy. Ctrl+D? One minute freeze. Also, doesn't delete any lines. Clicking into an editor? One minute freeze. It also takes everything with it, so e.g. my browser won't work while Eclipse freezes.
It is not possible to work like this. At all. My colleagues just went back to Eclipse 2018-09, but I need Java11, so I can't.
I could not find any bugs for this issue (a lot of bugs for Eclipse freezing, but none that should still be present in 2018-12).
Anyone else experienced something like that? It's our entire office, so it's not just one faulty computer. Could it have something to do with how Eclipse scatters its config files over the hard drive? Maybe it can't read the 2018-09 config files or something?
If you use the Project Explorer, this could be caused by bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=536918 which is already fixed for Eclipse 4.11 (and will be released as Eclipse 2019-03 in March)
You can use an integration build from http://download.eclipse.org/eclipse/downloads/
As workaround, it might also help to to close the Project Explorer View (in all perspectives) and use the Package Explorer instead.
As others have written, it might also be a memory issue. Open the Eclipse Preferences and
in the General section enable Show heap status so you can see it at the bottom of the window.
If this is the problem, edit eclipse.ini and increase the memory settings (open eclipse.ini and increase the number of the line with -Xmx. If you have a mac, right-click on the Eclipse Application, choose Package Contents, find it at Contents/Eclipse/eclipse.ini)
I was facing this "lagging"/"freezing" issue in Eclipse 2018-12 until I did this.
in eclipse.ini
-Xms256m
-Xmx4096m
Of course it has not stopped "freezing" completely, but The number of times has been tremendously dropped.

Why does my Eclipse takes so much times to clean files?

I'm using Eclipse Kepler on Windows 7 and recently it became more and more frequent that it takes lots of time when it has to delete files. For example in these contexts:
mvn clean launched from Eclipse
cleaning output folder in case of automatic projects build by Eclipse
deploying a war on a server (deletion of the previous deployment)
I've checked this old question but working in a fresh new workspace has no effect.
I may have a clue: to gain some time I 'help' Eclipse by deleting the files myself with Windows Explorer. Windows often launches a pop-up saying that I need admin right to do that. I just hit Enter (I am admin user) and the files are quickly deleted. If Eclipse had no right to delete the files I would have expected an error, instead it just takes much more time to actually delete the files.
Why could be the cause of that? Knowing that the clue may or may not be relevant.
For the record: no solution has been found to the problem. I got a new desktop with a fresh Win7 image and I don't have the problem, working with the same Eclipse projects.
This would indicate that the problem came from a misconfiguration of the Windows user permission. Sadly, no more details available.

Eclipse hangs on reverting resources

I use eclipse Indigo, subclipse 1.10.x and javaNL. Whenever I try to refresh my project in eclipse, it gets stuck at Reverting Resources 0% and Computing Update Requirements 0%. I try to kill eclipse and reopen the project and it still does the same. I do not understand why this happens. It started happening recently. Before it was working fine.
Question: I do not understand why this happens
General Answer: http://www.ihateeclipse.com/
(I may share this opinions and dont think Eclipse should be called a IDE but that wont fix your problem - hence lets proceed with possible workarounds).
Possible Workarounds:
1.) Starting eclipse in clean mode How to run eclipse in clean mode? and what happens if we do so?. (This solved aprox. 80% of my continuously returning 'I messed up my own state' issues I experienced).
2.) If that doesnt help - you would have to stop eclipse, identify the according files (or just any files holding such information) and delete them manually, then restart eclipse. Like I still encounter issues with my "Search Type" (Ctrl+T) and have to delete the files like described here Eclipse type hierarchy not always working (unfortunately I don't know anything about files regarding your current issue - so feel free to downvote my "answer" since its not directly answering your question).
The best things I found about "the full reset" seem to be: http://letsgetdugg.com/2009/04/19/recovering-a-corrupt-eclipse-workspace/ or http://blog.pdark.de/2011/09/02/restoring-a-corrupted-workspace-in-eclipse/ (Note: I haven't verified the described behaviors).
3.) Recreate Workspace - delete any eclipse belongings like the .metadata folder and keep only belongings of your project (e.g. sources, resources etc.). Then create a new eclipse project based on you existing project sources).
4.) If Steps 1-3 failed consider reinstalling Eclipse (include above Step 3 in this process again) or switching to a proper IDE that can at least handle its own state.
5.) I experienced rare cases where in the end such things were triggered by me rather than occurred magically out of nowhere by eclipse - I don't see any possibility on how you could manage that in your case unless you messed around with the eclipse source itself).
Hope this helps - Even thus the SO community is big I experienced way better results asking the eclipse developer community directly when it came to such specific issues (you however oftenly get a link to a open Bug ... that they created because of your question) and ended up "just importing into a new eclipse workspace from existing sources" whenever I experienced such issues lately (It takes me about 5 minutes to checkout our sources, start Eclipse with -clean as default and import existing Maven projects solving any eclipse-only issue - while each of those eclipse-issues can take days to be solved without any further advantage for my daily business)
I don't know if this will help any one but I had the same issue. Some links advised me to delete my metadata, which I did not want to do.
What fixed it for me was:
I have multiple eclipse workspaces, I manually closed my eclipse using the System Monitor/Taskbar as it wouldn't let me close as it was hanging.
I switched workspaces and it seems to run fine. So I switched back to the one that was hanging and the problem seemed to have gone.
This worked for me:
Go to to your workspace instalation, and manually delete the target directory under your maven projects (dont worry , maven will create another one when compiling). This removed my stuck Eclipse state (thread) in "Revert sources", always at 0%.
this helped me:
delete files "*.snap" under org.eclipse.core.resources in
worskpace/.metadata/.plugins/org.eclipse.core.resources/
and share project again (setup SVN settings)
I accidentally checked in target files to SVN. And the target files were huge ans hence it was stuck on reverting resources. Once I deleted those target files from SVN this issue never happened.But JBA's answer is pretty comprehensive so I will mark that as a right answer.
I have this same issue, and I just quickly cancel the "Rerverting Resources" task while it's in "waiting" mode when restart Eclipse.
This should work to 100% and helped in my case (no other tried solution worked):
Go to "Eclipse > Help > About Eclipse IDE > Installation Details
Uninstall the following packages "Subclipse", "Subclipse Integration for Mylyn", "Subversion 1.14 JavaHL", "Subversion Revision Graph", "SVN Client Adapter".
pluginsToUninstall
Go to the marketplace and install "subclipse" again.
Rightclick on your project > Team > Refresh/Cleanup
You are welcome. :)

Eclipse intermittent "cannot be resolved to a type" error

I keep running into a strange intermittent issue with eclipse for the past few days where I will be editing code, save it, and then eclipse starts reporting hundreds (or sometimes thousands) of MyClassName cannot be resolved to a type errors. The errors are completely bogus as the classes do exist, and if I do a clean and rebuild on the entire workspace the issue goes away. This is the second workspace in a row that it has suddenly happened to.
Has anyone else ever run into this before? Is there some way to fix this issue without recreating an entirely new workspace (which is extremely frustrating). I'm not entirely sure what keeps happening to seemingly corrupt my workspaces.
[Update]
For clarification this is happening with multiple projects that are all Java (web application) projects using only the standard 'Java Builder.'
Debugging Eclipse gone wrong is a painful task. I make it a routine habit to reinstall it, sad but true. The Eclipse Plugin framework tends to lead to these kinds of interactions . You don't mention what version of Eclipse and if it is EE or standard.
So, I'd suggest you try a fresh install of Eclipse. Another thing to try is change the JVM you are using to run Eclipse. The most widely used and tested JVM is still Sun/Oracle Java6.
I have had the best results using the standard version of Eclipse and only adding the EE stuff as needed, ie the Web Developer Tools.
If this happens on Windows with a virus scanner being installed, you may want to try excluding your workspace directory from the on-access scanner. I have two colleagues who get very annoying (and not reproducable) build errors quite often, as long as their TrendMicro virus scanner is enabled.
Happened to me with Eclipse Neon after git merge with multiple confilicts, I solved the issue with deleting and re-importing my project.

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.