Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Project doesn't build
Project doesn't build [message #214163] Wed, 06 June 2007 23:16 Go to next message
Eclipse UserFriend
Originally posted by: sam.brown.3jane.com

I have one java project that silently fails to build. I've found a
workaround: If I go into preferences and set the compliance level it
offers to rebuild everything, and this forces a build of the project
(along with the rest of my workspace).

This project was an existing code example from a downloaded program that I
attached (imported) to Eclipse. I've mucked about with its Build Path
settings some to get all the required libraries working, and have the
sneaking suspicion that I've missed something on that screen. The code is
free of syntax bugs - it complies correctly when the workaround described
above is applied.

Anyone care to enlighten me?

While I'm asking, is there an easy way to have the build automatically
export to a .jar when complete?
Re: Project doesn't build [message #214171 is a reply to message #214163] Wed, 06 June 2007 23:30 Go to previous messageGo to next message
Mark Dexter is currently offline Mark DexterFriend
Messages: 324
Registered: July 2009
Senior Member
Hi. Really dumb question. On the Project menu, you have the Build
Automatically option checked -- right? Mark Dexter
Re: Project doesn't build [message #214179 is a reply to message #214171] Wed, 06 June 2007 23:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sam.brown.3jane.com

Aye, it was checked.
Experimenting with unchecking it, I see that any file I modify will then
be rebuilt the next time I issue a "Rebuild All" command. Files unmodified
aren't rebuilt, even when told to.

Further experimentation also demonstrates that "Clean" rebuilds the
classfiles, which seems backwards to me. (After a clean, "Build All" still
doesn't build them, though.)
Re: Project doesn't build [message #214187 is a reply to message #214171] Thu, 07 June 2007 00:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sam.brown.3jane.com

Yes, that was checked. I've unchecked it, and still can't force a manual
rebuild with build all. (Though I now notice that any file I've modified
since the last build DOES get rebuilt, which is a large step forward.)
Re: Project doesn't build [message #214417 is a reply to message #214187] Thu, 07 June 2007 16:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Sam" <sam.brown@3jane.com> wrote in message
news:9680202e9470c23887aaff1c5fa3a562$1@www.eclipse.org...
> Yes, that was checked. I've unchecked it, and still can't force a manual
> rebuild with build all. (Though I now notice that any file I've modified
> since the last build DOES get rebuilt, which is a large step forward.)

Build All really means "Build All that isn't already built and hasn't
changed".

If you want to rebuild everything, Clean (and rebuild) is the way to do it.

Eclipse tries to avoid unnecessary rebuilding; if building a particular file
or project would not result in changed output, it skips that file or
project. It decides (generally speaking) by determine whether anything in
the source or settings changed.
Re: Project doesn't build [message #214592 is a reply to message #214163] Fri, 08 June 2007 12:40 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Sam wrote:
> I have one java project that silently fails to build. I've found a
> workaround: If I go into preferences and set the compliance level it
> offers to rebuild everything, and this forces a build of the project
> (along with the rest of my workspace).
>
> This project was an existing code example from a downloaded program that
> I attached (imported) to Eclipse. I've mucked about with its Build Path
> settings some to get all the required libraries working, and have the
> sneaking suspicion that I've missed something on that screen. The code
> is free of syntax bugs - it complies correctly when the workaround
> described above is applied.
>
> Anyone care to enlighten me?

As others have said, Eclipse uses an incremental compiler that is
intelligent about what needs to be built; you can always force a rebuild
via Project > Clean (assuming you have "Build Automatically" enabled,
which is almost always recommended).
Sometimes a project will have problems with its Build Path that prevent
it from building. This will show up in the Problems view but you have to
open the project Properties > Java Build Path to correct the problem.
Changing the Java Build Path will usually trigger a rebuild of the
project (Eclipse will prompt you).


> While I'm asking, is there an easy way to have the build automatically
> export to a .jar when complete?

The Eclipse builder does not do it automatically, but there are several
options:
1) you can manually invoke File > Export... to export a JAR
2) you can write a simple Ant script that builds the JAR from the output
directory where you have Eclipse putting compiled classes, then create a
custom Builder for the project that invokes that Ant script (see
Builders under project Properties).
3) you can write the Ant script as in Option 2 above, but instead of
setting it up to run automatically at every build, simply invoke it when
needed from the Ant view.

Option 3 is what I do for a current project that uses a "common" project
and several application projects that depend on it. The common project
changes infrequently so I manually invoke the Ant JAR-and-deploy script
when I need to.

Hope this helps,
Eric
Previous Topic:Search is broken
Next Topic:Subclipse
Goto Forum:
  


Current Time: Thu Apr 25 08:39:45 GMT 2024

Powered by FUDForum. Page generated in 0.08405 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top