[eclipse] eclipse stuck when building workspace

I am using eclipse 3.4.1 Java EE under Vista. It seems to like getting stuck when building my workspace. Canceling the build doesn't seem to do anything as well.

Why is this happening and how do I fix the problem?

This question is related to eclipse build windows-vista

The answer is


Deleting some of the JDT indexes (in .metadata.plugins\org.eclipse.jdt.core), particularly the big files, often fix or ease the problem for me.


I have this problem whe I have too much maven projects open at once. What I tend to do is:

  • Restart eclipse (sometimes I need to kill eclipse)
  • Disable automatic build immediatly (project > uncheck Build automatically)
  • Right click the project(s) I want to have rebuild
  • Close unrelated projects
  • Re-enable automatic build

This enables a functioning rebuild in 99% off the cases in my workspace.


In my case it helped to remove the source folders from my favorites in the Windows Explorer (Windows 8.0). It seems that the build was not actually stuck, but triggered in some kind of infinite loop (as mentioned here - Bug 342931).


In my case problem arise after importing downloaded project - stuck at 80% build. Solved by adding write permissions for group to project's files (Ubuntu 12.04).


I had same issue with my Eclipse and as a solution, I created new project, copied all resources manually (using windows copy/paste) to new project, deleted old project and that's it.

Sometimes, this happens due to improper System shutdown and Eclipse workspace started facing similar issues.

Hope it will work.


None of the the answers here worked for me. What worked was to delete the following folder

C:\Users\your username\workspace\project name.metadata.plugins\org.eclipse.core.resources.projects\project name\.indexes


In case there is a problem on start when building your project disable the build automatically from menu. Project -> Build Automatically. This solved my problem while more sophisticated solutions could not.


Restart eclipse.
It worked for me several times.


eclipse -clean did not work but following did

eclipse -clean -clearPersistedState

I've found that this might also happen if you rebuild a workspace with a project containing a lot of image data (such as a dedicated images project). Might be best to put something like that into its own workspace and handle it separately to the rest of the projects you deal with.

If you can't, then don't clean that project when you clean and rebuild. Only rebuild when necessary.


Rather than debug and find the exact root cause(s) for this, I just deleted the projects and the metadata folder. Eclipse will rebuild the .metadata file the next time it's launched.

I then pulled in the latest project code and the problem was solved. It was more work as I had to reconfigure everything, including my servers, but build workspace had been stopping at 50% for anywhere from 3 to 5 minutes before it would completely finish, so it was worth the effort.

Also, I've found that with Eclipse, if you stop the build workspace before it completes and shut down Eclipse if that hangs up everything, you can really mess up your configuration and waste lots of time trying to get it stable again. I'm using Eclipse Oxygen, but I've had this happen in all the versions of Eclipse I've used, so I really try to avoid it, if possible.


I just restarted eclipse and it started working the next time.


Some time it's very helpful to execute eclipse from command line with "-clean" parameter to enforce it produce clean up for workspace.


The accepted answer allowed me to get Eclipse started again, but it seems that the projects lost their metadata. (E.g., all the Git/Gradle/Spring icons disappeared from the project names.) I have a lot of projects in there, and I didn't want to have to import them all over again.

So here's what worked for me under Kepler. YMMV but I wanted to record this just in case it helps somebody.

Step 1. Temporarily move the .projects file out of the way:

$ cd .metadata/.plugins/org.eclipse.core.resources
$ mv .projects .projects.bak

Step 2. Then start Eclipse. The metadata will be missing, but at least Eclipse starts without getting stuck.

Step 3. Close Eclipse.

Step 4. Revert the .projects.bak file to its original name:

$ mv .projects.bak .projects

Step 5. Restart Eclipse. It may build some stuff, but this time it should get through. (At least it did for me.)


I tried lots of these suggestions, but the only thing that finally worked for me was creating a new workspace, and freshly checking out all my projects into that folder. Then it worked fine ;-)


If you are using Maven as a build tool you might want to:

  1. Close eclipse

  2. Delete dependency directories located in .m2/repository/ - in Linux it's located under Home directory and in Windows it should be in c:\Users<YourUsername>.m2 (replace '' with your username)

  3. Start Eclipse and enjoy normal work :)

That helped me resolve this issue and I hope it helps you too. :)
Cheers!

P.S. I've edited my answer (as @howlger asked) where it was also suggested to delete .eclipse and .p2 folders as it can do harm (although it did NOT in my case + I had to reinstall some of plugins I'm using).


Refresh all the projects u want to build. Worked


Unselect automatic build using Eclipse-> Windows->Preferences helps fixing this issue.


Inside the project folder open .project file. There is a bad entry and it might help

    <buildCommand>
        <name>org.eclipse.m2e.core.maven2Builder</name>
        <arguments>
        </arguments>
    </buildCommand>

Looking at the logs in [workspace]/.metadata/.log provided useful information for me. Turned out there was a java.lang.OutOfMemoryError: PermGen space error when the workspace build would hang. This can be edited in the eclipse.ini or sts.ini(If you are using SpringSource Tool Suite) file.


I just had the same problem.

By using Task Manager to kill the build process and exiting Eclipse with no projects open, I was able to get back into Eclipse and clean the project without opening it. I then restarted Eclipse again,loaded my project and all OK.


Sometimes the problem seems to be fixed by killing other programs which have files open from the project folder.


I was able to solve this by removing extra folder that Eclipse had created in my eclipse installation folder. I didn't install and I was using Eclilpse Neon 3 with Spring Tool suite also installed. But, when I looked into extracted eclipse installation, I had C: folder which had some folder structure. It was mirror image of my Downloads folder. I removed it and restarted.

It worked for me!


I was able to fix this with the following:

First, exit Eclipse. Then temporarily move the following .projects folder to a safe location:

mv .metadata\.plugins\org.eclipse.core.resources\.projects projects

Start and exit Eclipse, then move the .projects folder back to where it was originally:

mv projects .metadata\.plugins\org.eclipse.core.resources\.projects

Use at your own risk, of course.


Eclipse often freezes for me at 44% if I'm debugging Android over USB. When disconnecting the device, Eclipse starts.


I faced Similar issue in Eclipse Indigo. I changed the HeapSize it started working correctly. I just added following eclipse.ini file -vmargs -Xms1024m -Xmx1024m

It worked fine after increasing the VM size


I faced the same problem when I tried to install Angular.js with bower in my project. I seems bower has lots of javascript files it downloaded automatically which caused my IDE to stuck in validation process for a long time. So, I solved this problem this way,

  • I first installed tern.js 0.9.0.
  • Then I went to the project properties, selected tern script path included only the path I needed for validation, My project's javascript folder. I excluded other path like placeholders, Angular.js files, Jquery files.
  • I selected the Javascript from the properties again and did the same things in include path's source.

My IDE currently working without freezing. I took help from there. Tern I guess it can be helpful, where any IDE stuck due to lots of Javascript file.


Step1:

Open project directory and edit .project file, remove following lines to disable java script validation.

  <buildCommand>
      <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
      <arguments>
      </arguments>
    </buildCommand>

Save file.

Step 2:

Go to Eclipse installed directory and open eclipse.ini(or sts.in if you have STS), change xms and xmx value based on your RAM size of your computer.

-Xms512m
-Xmx1024m
-XX:MaxPermSize=256m

OR: in windows, go to eclipse shortcut in desktop, right click->properties-> add following: C:\software\eclipse\sts-3.6.2.RELEASE\STS.exe -clean -Xms512m -Xmx1024m

Run Eclipse.

Go to Eclipse->windows->preference->Validation, enable Suspend all validators. Do this if you don't want do any validation listed in the list given in Validator panel.


The only solution for me (Luna 4.4.1) was this:

Go to Project Properties > Builders and then uncheck the Javascript Validator.


Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to build

error: This is probably not a problem with npm. There is likely additional logging output above Module not found: Error: Can't resolve 'core-js/es6' WARNING in budgets, maximum exceeded for initial How can I change the app display name build with Flutter? Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0) Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation' Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details Component is part of the declaration of 2 modules Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

Examples related to windows-vista

Batchfile to create backup and rename with timestamp How do I find which application is using up my port? How do you run a command as an administrator from the Windows command line? Automatic confirmation of deletion in powershell eclipse stuck when building workspace How do you clear your Visual Studio cache on Windows Vista? Maximum filename length in NTFS (Windows XP and Windows Vista)? Launching an application (.EXE) from C#? How to do a HTTP HEAD request from the windows command line? Request UAC elevation from within a Python script?