Home » Newcomers » Newcomers » Can't Use Ant to Build
Can't Use Ant to Build [message #127936] |
Fri, 06 January 2006 03:23  |
Eclipse User |
|
|
|
Originally posted by: hal.thresholddigital.com
I'm working on an open source project (IzPack) and I'm having a bit of
trouble figuring out how to get Eclipse to use Ant to build the project.
When I first tried to set up Ant to build, I kept getting an error for "no
javac". I was using the same JDK as for my project. That seems to have
been fixed -- I can't remember what it was I did, but I got fed up with it
this afternoon, unchecked Ant as a builder, and left the regular Java
Builder. When I finished with a class, I'd just use the command line to
run Ant. Whenever I got the errors, if I changed anything and tried to
build with Ant again, it did nothing. To get the error message again so I
could try to figure out what to do, I had to remove the Ant Builder and
recreate it again.
This evening, just as one last try, I deleted the last non-working attempt
of an Ant Builder and re-created it. I didn't do anything different, but
this time it worked and built the entire project.
Great, right?
No.
With the standard Java Builder, whenever I saved a class file, it would
build it automatically. I haven't changed the settings (it's still
supposed to build when I save and build in the background), but now it
won't build at all after the first time, even when I use a keyboard
shortcut or select Build on the menu.
I figure the "no javac" problem was solved when I must have told it to use
the JDK environment (I don't remember doing it.) Or maybe I edited
my .bashrc file (I'm on Linux) to add environment variables without
remembering it (I know JAVA_HOME was mentioned in the error). That part is
working now. If someone has comments on this or a suggestion to make sure
whatever the problem was is fixed now, I'm willing to hear it.
What I need to know now is why won't Ant build the project more than once
and how can I fix it?
Thanks!
Hal
|
|
|
Re: Can't Use Ant to Build [message #127985 is a reply to message #127936] |
Fri, 06 January 2006 11:15   |
Eclipse User |
|
|
|
What settings have you set up on the Targets tab of the Ant builder?
Have you set a working set of resources that only will trigger the build on
the Build Options tab of the builder?
HTH
Darins
"Hal Vaughan" <hal@thresholddigital.com> wrote in message
news:dpl9fv$ejf$1@utils.eclipse.org...
> I'm working on an open source project (IzPack) and I'm having a bit of
> trouble figuring out how to get Eclipse to use Ant to build the project.
> When I first tried to set up Ant to build, I kept getting an error for "no
> javac". I was using the same JDK as for my project. That seems to have
> been fixed -- I can't remember what it was I did, but I got fed up with it
> this afternoon, unchecked Ant as a builder, and left the regular Java
> Builder. When I finished with a class, I'd just use the command line to
> run Ant. Whenever I got the errors, if I changed anything and tried to
> build with Ant again, it did nothing. To get the error message again so I
> could try to figure out what to do, I had to remove the Ant Builder and
> recreate it again.
>
> This evening, just as one last try, I deleted the last non-working attempt
> of an Ant Builder and re-created it. I didn't do anything different, but
> this time it worked and built the entire project.
>
> Great, right?
>
> No.
>
> With the standard Java Builder, whenever I saved a class file, it would
> build it automatically. I haven't changed the settings (it's still
> supposed to build when I save and build in the background), but now it
> won't build at all after the first time, even when I use a keyboard
> shortcut or select Build on the menu.
>
> I figure the "no javac" problem was solved when I must have told it to use
> the JDK environment (I don't remember doing it.) Or maybe I edited
> my .bashrc file (I'm on Linux) to add environment variables without
> remembering it (I know JAVA_HOME was mentioned in the error). That part
> is
> working now. If someone has comments on this or a suggestion to make sure
> whatever the problem was is fixed now, I'm willing to hear it.
>
> What I need to know now is why won't Ant build the project more than once
> and how can I fix it?
>
> Thanks!
>
> Hal
|
|
|
Re: Can't Use Ant to Build [message #128292 is a reply to message #127985] |
Sat, 07 January 2006 13:05  |
Eclipse User |
|
|
|
Originally posted by: hal.thresholddigital.com
Darin Swanson wrote:
> What settings have you set up on the Targets tab of the Ant builder?
> Have you set a working set of resources that only will trigger the build
> on the Build Options tab of the builder?
>
> HTH
> Darins
Thanks, Darin. I've looked at this. It helps me start looking at it.
Am I wrong that the targets can be set in build.xml? IzPack has them set in
IzPack/src/build.xml and I've specified that as the build file in the Main
tab. Do I need to make additional changes in the Target tab, or aren't
they picked up from the file? (The one time it did build correctly, it
worked the same way it it did when I typed "ant -f src/build.xml".
As for the "Build Options", there's only 2 choices, "Run in Background" and
"Specify working set of relevant resources". On the 2nd, I checked it and
specified this project as the only resource, but it doesn't make a
difference.
Previously, with "Java Build" as my only build source, it would
automatically rebuild every time I saved a file. Should I not expect that
with Ant instead? (I noticed there are no settings to change for "Java
Build.")
Thanks, anyone, for any info!
Hal
> "Hal Vaughan" <hal@thresholddigital.com> wrote in message
> news:dpl9fv$ejf$1@utils.eclipse.org...
>> I'm working on an open source project (IzPack) and I'm having a bit of
>> trouble figuring out how to get Eclipse to use Ant to build the project.
>> When I first tried to set up Ant to build, I kept getting an error for
>> "no
>> javac". I was using the same JDK as for my project. That seems to have
>> been fixed -- I can't remember what it was I did, but I got fed up with
>> it this afternoon, unchecked Ant as a builder, and left the regular Java
>> Builder. When I finished with a class, I'd just use the command line to
>> run Ant. Whenever I got the errors, if I changed anything and tried to
>> build with Ant again, it did nothing. To get the error message again so
>> I could try to figure out what to do, I had to remove the Ant Builder and
>> recreate it again.
>>
>> This evening, just as one last try, I deleted the last non-working
>> attempt
>> of an Ant Builder and re-created it. I didn't do anything different, but
>> this time it worked and built the entire project.
>>
>> Great, right?
>>
>> No.
>>
>> With the standard Java Builder, whenever I saved a class file, it would
>> build it automatically. I haven't changed the settings (it's still
>> supposed to build when I save and build in the background), but now it
>> won't build at all after the first time, even when I use a keyboard
>> shortcut or select Build on the menu.
>>
>> I figure the "no javac" problem was solved when I must have told it to
>> use
>> the JDK environment (I don't remember doing it.) Or maybe I edited
>> my .bashrc file (I'm on Linux) to add environment variables without
>> remembering it (I know JAVA_HOME was mentioned in the error). That part
>> is
>> working now. If someone has comments on this or a suggestion to make
>> sure whatever the problem was is fixed now, I'm willing to hear it.
>>
>> What I need to know now is why won't Ant build the project more than once
>> and how can I fix it?
>>
>> Thanks!
>>
>> Hal
|
|
|
Goto Forum:
Current Time: Sat Jul 19 13:31:32 EDT 2025
Powered by FUDForum. Page generated in 0.08149 seconds
|