Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse hangs in building project after each save

Tags:

java

eclipse

ant

This has become so annoying. Each time I save an Ant build I get Eclipse in rebuilding itself... I have Java Project which depends from a non-Java project. When I edit a file in the non-Java project, save, build. I get the whole project sync process launched... 1-5 minutes later I get the prompt back.

like image 775
millebii Avatar asked Jan 22 '11 16:01

millebii


2 Answers

You could try to turn off automatic building globally in the Project menu. If you do this, the Build project... and Build all options become enabled, allowing you to manually build when necessary.

Another option may be to set the refresh workspace policy of your executed ANT build (granted you are using the Eclipse AntRunner): in the Run configuration on the refresh tab you could manually select only to update the project changed by the ANT build.

like image 188
Zoltán Ujhelyi Avatar answered Sep 20 '22 02:09

Zoltán Ujhelyi


I had the same problem, everytime I edited web.xml, it would hang showing busy icon for 5-10 seconds. I tried an older web project, and it worked fine.

I discovered that the web.xml web-app tag was different and after changing it, the problem went away. I think it has something to do with the lookup of XML schemas.

I think it is possible to disable the schema check (that goes out and download the schema every time).

But otherwise find what I changed below to make it stop hanging on every save.

From:

`<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">`

To:

`<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
  version="2.5">`

I know the version is different 2.4->2.5 but notice it references schema location differently.

like image 27
Tommy G. Avatar answered Sep 21 '22 02:09

Tommy G.