Bug 41587 - Ant-1.7.0 <available> task, under JDK1.3.1_19, can't find junit.jar in ${user.home}/.ant/lib
Summary: Ant-1.7.0 <available> task, under JDK1.3.1_19, can't find junit.jar in ${user...
Status: RESOLVED WONTFIX
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.7.0
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-10 09:35 UTC by Jacob Kjome
Modified: 2009-05-07 01:43 UTC (History)
0 users



Attachments
test build file (648 bytes, text/xml)
2007-02-10 09:38 UTC, Jacob Kjome
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Kjome 2007-02-10 09:35:57 UTC
As reported on the Ant user list [1], there seems to be a problem with the
<available> task in Ant-1.7.0 when running under JDK1.3.1_19 (probably any 1.3.1
sub-version) on WinXP.  Using the following build file, Junit is not found on
the classpath when I have junit.jar (either 3.8.1 or 3.8.2) in
${user.home}/.ant/lib.  However, it is found if I move junit.jar to ${ant.home}/lib.

3 notes of interest:

1.  Under JDK1.6 on my machine, junit.jar is found just fine in
${user.home}/.ant/lib.

2.  Ant-1.6.5 has no problem under any JDK.  It works 100% of the time no matter
the JDK and finds junit.jar in either location.

3.  It was suggested on the list that maybe there's a bug in JDK1.3.1 where it
gets URL's wrong when the working directory is on a different drive than
junit.jar.  I tested this theory out by putting my build file on the C:\ drive,
which is where ${user.home}/.ant/lib is.  It made no difference.  Ant-1.7.0
still can't find it under JDK1.3.1_19.

Since Ant-1.6.5 works no matter what, it seems to me that the bug here is
probably in Ant-1.7.0, though it only shows itself under older JDKs.  I haven't
tested JDK1.4.x because I don't have it installed

Here's the build file for testing...

<project name="findjunit" default="build.something">

  <target name="-check.junit.exists">
    <available classname="junit.framework.TestCase" property="junit.exists"
value="true"/>
  </target>

  <target name="-check.junit" depends="-check.junit.exists" unless="junit.exists">
    <echo>JUnit is not currently available to the build environment. 
Because of this, all targets that require JUnit will be skipped. To 
enable these targets, place a copy of JUnit (get latest version at 
http://www.junit.org/) in ANT_HOME/lib.</echo>
  </target>

  <target name="build.something" depends="-check.junit" if="junit.exists"/>

</project>


[1] http://marc.theaimsgroup.com/?t=117083869300004&r=1&w=2


Jake
Comment 1 Jacob Kjome 2007-02-10 09:38:07 UTC
Created attachment 19567 [details]
test build file
Comment 2 Stefan Bodewig 2009-05-07 01:43:25 UTC
Ant's trunk has dropped support for Java 1.3, so I'm marking this as WONTFIX