tags:

views:

87

answers:

6

Whenever i run my application in eclipse it starts building and then runs. As i am haing thousands of classes it taking too much time to build everytime. May i know the reason please and what i have to do to avoid it?

A: 

"thousands of classes" - there's the problem.

If those are all yours, you can't help but create the .class files when they're needed.

I'd be surprised if you were touching every one of those classes. Doesn't Eclipse do incremental builds, only compiling the .java files that have changed since the last build? If not, I'd look into setting it up to do so. Maybe you could try Ant, which does do incremental builds.

duffymo
Eclipse does indeed have incremental builds (compiles in the background) but only if "Build automatically" is enabled and his project is actually configured to use Eclipse as the builder. Thousands of classes aren't really a problem then (we currently have 3,470 in one of our projects).
ZoogieZork
+1  A: 
  • make sure Project > Build automatically is checked
  • righ-click your project, Properties > Builders and consider removing any redunant builders. Be very careful as this might disable some desired functionality.
Bozho
A: 

Do you use any external libraries as source files? This may be the problem.

JCasso
A: 

If those thousands of classes are libraries you are using you should use Jars instead.

Fabian Steeg
A: 

You've tagged your question "Java" so I'm going to assume it's not GWT or anything like that. But could you let us know if this is a native Eclipse project? Or an Ant/Maven project imported into Eclipse? Is it a plain Java app? or an EE app that gets deployed to an app server? What app server do you use?

Also, when you say, it's taking too long, what do you mean? 1 minute? 5 minutes? 30 minutes (:O) ?

Jack Leow
+1  A: 

friends i got the answer for my scenario:

There will be Build(if required) before launch check button was marked true. because of which it builds even if you have build it just before running. So i have unmarked it on which its running immediately.

Windows > Preferences > Run/Debug > Launching

GK