Project doesn't build [message #214163] |
Wed, 06 June 2007 19:16  |
Eclipse User |
|
|
|
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 #214592 is a reply to message #214163] |
Fri, 08 June 2007 08:40  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.06868 seconds