When I install ant and ant-optional (version 1.6.2-r2), the commons-net jar is
not installed properly. To fix it, I simply add a link in /usr/share/ant/lib
to /usr/share/commons-net/lib/commons-net.jar.
root:/usr/share/ant/lib# ln /usr/share/commons-net/lib/commons-net.jar
Reproducible: Always
Steps to Reproduce:
1.emerge ant-optional
2.Create a build.xml file with an ftp task
Actual Results:
BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
Expected Results:
build successfully
Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r1,
2.6.7-gentoo-r10)
=================================================================
System uname: 2.6.7-gentoo-r10 i686 Intel(R) Pentium(R) M processor 1.60GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe -funroll-loops"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo
http://gentoo.mirrors.pair.com/ http://open-systems.ufl.edu/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 arts avi berkdb bidi cdr crypt cups dvd emacs encode
esd foomaticdb gdbm gif gpm gtk gtk2 imlib java jpeg libg++ libwww mad mikmod
motif mpeg ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png python
quicktime readline samba sdl slang spell ssl svga tcpd truetype usb x86 xml2
xmms xv zlib"
Actually, it appears that this is a classpath issue. The commons-net jar
should be in the classpath when Ant runs. By creating a link in the lib
directory, I had Ant automatically add the jar to the classpath (however, I
don't believe that this is the correct way to fix the issue). Also, I get the
feeling that there may be other jars that should be in the classpath too (try
out all the options for the ftp task).