Bug#337698: ant: fails with jamvm: "Unable to find a javac compiler; "

Timo Lindfors timo.lindfors at iki.fi
Sat Nov 5 20:30:24 UTC 2005

Package: ant
Version: 1.6.5-3
Severity: normal

ant fails with "Unable to find a javac compiler;" if
/etc/alternatives/java points to jamvm.

$ wget http://www.beanshell.org/bsh-2.0b4-src.jar
$ unzip bsh-2.0b4-src.jar
$ cd BeanShell-2.0b4/
$ sudo update-alternatives --config java

There are 5 alternatives which provide `java'.

  Selection    Alternative
      1        /usr/bin/jamvm
      2        /usr/bin/java-sablevm
      3        /usr/bin/gij-wrapper-4.0
*+    4        /usr/lib/jvm/java-gcj/bin/java
      5        /etc/alternatives/kaffe-system/bin/java

Press enter to keep the default[*], or type selection number: 1
Using `/usr/bin/jamvm' to provide `java'.
$ ant
Unable to locate tools.jar. Expected to find it in /usr/lib/tools.jar
Buildfile: build.xml





    [mkdir] Created dir: /home/lindi/local/beanshell/BeanShell-2.0b4/classes

    [javac] Compiling 148 source files to /home/lindi/local/beanshell/BeanShell-2.0b4/classes

/home/lindi/local/beanshell/BeanShell-2.0b4/build.xml:163: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Total time: 16 seconds

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.4.29sauna
Locale: LANG=C, LC_CTYPE=fi_FI (charmap=ISO-8859-1)

Versions of packages ant depends on:
ii  gij [java-virtual-machine]    4:4.0.2-1  The GNU Java bytecode interpreter
ii  gij-4.0 [java1-runtime]       4.0.2-3    The GNU Java bytecode interpreter
ii  jamvm [java1-runtime]         1.3.3-2    virtual machine which conforms to 
ii  kaffe                         2:1.1.6-3  A JVM to run Java bytecode
ii  kaffe-pthreads [kaffe]        2:1.1.6-3  A POSIX threads enabled version of
ii  libxerces2-java               2.6.2-3    Validating XML parser for Java wit
ii  sablevm [java1-runtime]       1.11.3-1.1 Free implementation of Java Virtua

Versions of packages ant recommends:
ii  ant-optional                  1.6.5-3    Java based build tool like make - 
ii  eclipse-ecj [java-compiler]   3.1.1-3    Eclipse Java compiler and Ant plug
ii  eclipse-ecj-gcj [java-compile 3.1.1-3    Native version of the Eclipse Java
ii  gcj [java-compiler]           4:4.0.2-1  The GNU Java compiler
ii  gcj-4.0 [java-compiler]       4.0.2-3    The GNU compiler for Java(TM)
ii  jikes                         1:1.22-3   Fast Java compiler adhering to lan
ii  jikes-sablevm [java-compiler] 1.11.3-1.1 Wrapper for jikes using classes fr
ii  kaffe-pthreads [java-compiler 2:1.1.6-3  A POSIX threads enabled version of

-- no debconf information

More information about the pkg-java-maintainers mailing list