Hi,
>
> I want to use the junit task. Therefore I downloaded the optional.jar
> archive
> and put it into %ANT_HOME%\lib.
>
> Nevertheless I get the error:
> Could not create task of type: junit because I can't find it
> in the list
> of task class definitions.
>
> When I start ant with the -debug flag, the output does not list the
> junit UserTask.
> Other tasks from the optional package like ejbc and javacc are listed.
> The optional.jar archive is listed in java.class.path.
>
I got this error too - I was not using the fork option. It worked when I
turned on the fork=yes option.
I think the error is due to junit not being on the ant vm classpath - its
only added in for fork'ed jobs.
So, you should be able to get it to work by amending your build script to
include the optional.jar in the class path.
Hope this helps,
Chris
================================================================================================
This electronic message (email) and any attachments to it are subject to copyright and
are sent for the personal attention of the addressee. Although you may be the named
recipient, it may become apparent that this email and its contents are not intended
for you and an addressing error has been made. This email may include information that
is legally privileged and exempt from disclosure. If you have received this email in
error, please advise us immediately and delete this email and any attachments from
your computer system.Rabobank International is the trading name of Coöperatieve
Centrale Raiffeisen-Boerenleenbank B.A. which is incorporated in the Netherlands.
Registered with the Registrar of Companies for England & Wales No. BR002630 and
regulated by the SFA for the conduct of investment business in the UK.
The presence of this footnote also confirms that this email has been automatically
checked by Rabobank International for the presence of computer viruses prior to it
being sent, however, no guarantee is given or implied that this email is virus free
upon delivery.