Bug#251527: antlr task broken when using Debian-dist'd /usr/share/ant/lib/ant-launcher.jar

Robert Fleming Robert Fleming <fleming@cs.washington.edu>, 251527@bugs.debian.org
Fri May 28 16:36:02 2004


Package: ant
Version: 1.6.1-1
Severity: normal

This build.xml:

-----cut-----
<project default="test">
  <target name="test">
    <antlr target="Test.g"/>
  </target>
</project>
-----cut-----

causes Ant to output this message:

-----cut-----
BUILD FAILED
..../build.xml:3: Could not create task or type of type: antlr.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual 
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file: 
 - You have misspelt 'antlr'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
   and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and optional.jar is absent
   Fix: look for optional.jar in ANT_HOME/lib, download if needed
 - The task was not built into optional.jar as dependent
   libraries were not found at build time.
   Fix: look in the JAR to verify, then rebuild with the needed
   libraries, or download a release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task 
   and needs to be declared using <taskdef>.

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 0 seconds
-----cut-----

I found that replacing the /usr/share/ant/lib/ant-launcher.jar (which is
a symlink to ../../ant1.6/lib/ant-launcher.jar) with ant-launcher.jar
from the apache-ant-1.6.1-bin.tar.bz2 distributed by Apache fixes the
problem.

Here's a recursive diff of the two (extracted) jar files:

-----cut-----
diff -r apache/META-INF/MANIFEST.MF debian/META-INF/MANIFEST.MF
3c3
< Created-By: 1.4.1_02-b06 (Sun Microsystems Inc.)
---
> Created-By: 1.1.3 (Kaffe.org project)
Binary files apache/org/apache/tools/ant/launch/AntMain.class and debian/org/apache/tools/ant/launch/AntMain.class differ
Binary files apache/org/apache/tools/ant/launch/Launcher.class and debian/org/apache/tools/ant/launch/Launcher.class differ
Binary files apache/org/apache/tools/ant/launch/LaunchException.class and debian/org/apache/tools/ant/launch/LaunchException.class differ
Binary files apache/org/apache/tools/ant/launch/Locator$1.class and debian/org/apache/tools/ant/launch/Locator$1.class differ
Binary files apache/org/apache/tools/ant/launch/Locator.class and debian/org/apache/tools/ant/launch/Locator.class differ
-----cut-----

But I did not dig to see if the difference was only the compiler, or
whether different source revisions went into the class files.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.5-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8

Versions of packages ant depends on:
ii  gij-3.3 [java-virtual-mac 1:3.3.3-9      The GNU Java bytecode interpreter
ii  j2re1.4 [java-virtual-mac 1.4.0.99beta-1 Blackdown Java(TM) 2 Runtime Envir
ii  libant1.6-java            1.6.1-1        Java based build tool like make
ii  libxerces2-java           2.6.1-1        Validating XML parser for Java wit

-- no debconf information