Eclipse unable to clean build output - java

I have an Eclipse (4.4.1) working set consisting of ~60 projects (the number may be relevant, as it takes more time to refresh the workspace). Occasionally, I encounter build failures because Eclipse is unable to clean the output folder before build:
It turned out that the process which locks the file is Eclipse itself:
It also turned out that files being locked are always of XML content. Particularly, if I define resources with *.foo extension as XML files (via Preferences -> General -> Content Types), there's a good chance they will be locked, too, once they're copied to the output path.
I thought the problem was caused by all XML resources being validated automatically:
-- so I added exclusion filters 1st and even disabled XML/XSD validation entirely. The problem stopped occurring that often, but still emerges from time to time. Refreshing or closing-reopening a project isn't helpful.
The only remedy is restarting Eclipse or running Unlocker every 1/2 hour, which is not very convenient.
Any ideas how to solve or at least further diagnose this?

Just my 2 cents.
Perhaps you can fix this issue by following this steps:
Project -> Properties -> Builders -> New -> Program
Define a custom "Cleaner"-Program, for example Unlocker or your own Java- or CMD-script
Move your custom Builder-Program up. It should be the first Builder in the list
P.S. some times i have similar problems caused by Avira Antivirus Scanner...

Disable third-party version control daemons. (Like TGitCache).
They only lock resources for a short while and are not visible in Process Explorer, but are the most frequent cause of such failures.

Assuming that XML Validation is the main cause of your problem, I suggest you extend your search for validation points in your projects' configuration, to set off all of them:
General preferences/Validation
General preferences/XML/XML files/Validation (the "honour all schema locations" option might be causing delay at validating)
Project preferences/Validation (check them; might be overriding the general preferences)
Project preferences/Builders/Validator
Hope it helps.

I have experienced similar issues. Yes, the number of projects is probably the cause. Close the projects not in use. If that cleans things up moving groups of related project into separate work spaces should help you out.
i.e File-> Close project

I'm not familiar with the problem, but I would tackle the problem this way:
download File Leak Detector
add the agentpath to your eclipse.ini (e.g.,
-javaagent:path/to/file-leak-detector.jar=http=19999, see documentation of File Leak Detector)
when the problem happens again, see which (eclipse) class is responsible for holding a handle of the file
Find out what is the purpose of the class that holds the handle
This way, you are maybe able to pin down the Eclipse feature that causes your problem.

Related

(Bad) lagg on auto complete in Eclipse

Basically when I auto complete on Eclipse (By pressing CTRL+Space) the program laggs for about 5 seconds. This is getting really annoying because I use the auto complete alot. How do I fix this?
The workspace I'm working on is located on a NAS with a 1Gbit/s connection. Could this be causing it?
Thanks.
Check if problem exists with local resources too
Create a local workspace and open it with same eclipse instance. Now create a simple java project by new project wizard at your local machine inside this workapce and try code completion there. If it's still slow go to Step 2.
(by the way - I wouldn't store workspace information on remote side, but always local)
Check proposal kinds
If it's not a network issue and the problem still exists on a simple local workplace with local sources you should inspect your proposal setup as shown in next picture.Maybe one of the proposal kinds is slowing down your IDE. You can experiment with turning off proposal kinds sequential to find the problematic one.
System requirements
If you got stil the problem after doing Step 1-2 maybe your system has not enough power/memory to provide eclipse (but normally not the reason - I am using eclipse at Linux on an old T61 notebook with 4 GB Ram + SSD and it works fine!)

Eclipse: User Library Settings Not Saving

I'm working with Eclipse, and I've ran into this weird problem where my User Library settings won't save. Here's the peculiar part: they save for the current session, but when I close out of Eclipse and re-open it, the settings are reverted.
I'm trying to remove the follow parts from my library:
When I remove them, they're gone, but when I reboot Eclipse, they're basically right back here in the library again. It's causing issues because those parts aren't needed/even physically present anymore.
I've tried the following to remedy the issue:
Deleting my workspace
Deleting project Classpaths
Deleting the entire library and re-adding it
I have no idea where the hell this is coming from at this point. That's why I'm here. Pls send help.
I wasn't able to fix this problem, but the way to work around it is by simply making a new library and using it instead. It seems that it'll still update and save new libraries, just this one was locked for some reason.
The way I personally got around it was by putting the JARs into the classpath directly instead of using a user library.

Linux Version of Eclipse is freezing when trying to open binary files (with .bin extension)

I had tried opening binary files of size 32MB. Eclipse (in Linux version) is freezing and I'm unable to perform any other operations (because of this hang in the Eclipse product).
I'm not even able to run other processes (like Task manger to exit the Eclipse IDE) which forces me to re-boot the system.
It seems that there is a problem in a particular plugin that you are using in your product, and that it is affecting your users.
If the plugin developer isn't helping you, your options are limited:
You could "bug him" about it ... but this probably won't help.
You could offer him (or someone else) money to fix the problem.
You could try to find and fix the problem for yourself (assuming that the plugin is open source).
You could identify an alternative plugin with the functionality you require.
You could implement a replacement plugin yourself ... or pay someone else to do it.
From the technical perspective, I doubt that we can help you unless you explain in depth what the nature of the problem is, and what you have found. On the face of it, it sounds like a scalability issue; i.e. the plugin is using an SWT widget that does not work with huge files. If that is what the problem is, then the technical solution is probably to use the widget in a different way ... that avoids the issue.
Opening 30Mb binary files in an editor is kind of pathological.

Recover corrupted java file

I tried to reimport my android project on eclipse to solve a problem but I accidently overwrote all my files in the project. All of them had been corrupted which means their size is now 0B...
I tried to use Local History but it's useless since my project is no longer in my workspace, same for .metadata.
I also tried to use Recuva (Software for recovering files) which see my files with their real size but when I try recover them, their size is always 0B...
I lost about 7 days of work and I don't really want to rewrite my code using Java Decompiler...
So my question is, is there any solution to recover that files ?
I wrote 200 lines of code and suddenly system restarted. I lost all code. But I recovered data from eclipse's local history. Right click on the file -->replace with-->previous from Local History
Eclipse has a local history, although by default it's set very low - one of my first tasks when setting up a new development machine is to up the values (in addition to my other version control)
If you do have a history you can right click on your class, and select compare with local history.
You could try decompiling with something like JD-GUI. It might not be as onerous as you think. Obfuscators exist for a reason.
It is not really programming question, but i had similar situation and "Mini Tool Power Data Recovery" tool helped me (it is paid tool, free version exists, but maybe you can search in this direction and find something open source). I tried some another tools then, but with no results.

Validating GWT components takes forever

Validating GWT components process in Eclipse takes ages, almost impossible to do productive work. I have selected from my Eclipse->Window->Preferences->Validators: selected Supend all validators still Eclipse validates GWT components which is painfully slow. How can I fix this? It's very hard when eclipse just validates the whole application every time I save.
We had the same phenomenon. Upgrading to Eclipse Juno/4.2 fixed the problem for us.
Another possible solution is described here.
I had the same problem and this solved the issue:
Right click project -> properties -> JavaScript -> Include Path
Then add an Exclude path to your compiled GWT files like this. You dont need to validate them:

Categories