Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant FTP task - cannot create type

Tags:

ant

Could someone help me with Ant? I want to deploy some files through FTP but i still can't due to error:

Could not create type ftp due to java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClientConfig

In ant lib directory I have:

  • lrwxrwxrwx 1 root root ant-bootstrap.jar -> ../../java/ant-bootstrap.jar
  • lrwxrwxrwx 1 root root ant-commons-net.jar -> ../../java/ant/ant-commons-net.jar
  • lrwxrwxrwx 1 root root ant.jar -> ../../java/ant.jar
  • lrwxrwxrwx 1 root root ant-launcher.jar -> ../../java/ant-launcher.jar
  • lrwxrwxrwx 1 root root commons-net.jar -> /usr/share/java/commons-net.jar

Thanks for any help.

like image 550
Josef Zamrzla Avatar asked Dec 16 '22 02:12

Josef Zamrzla


2 Answers

I assume that you are using ant 1.8.

You need apache-commons-net-2.0.jar and jakarta-oro-2.0.8.jar in the lib folder as listed in this blogpost and in the docs(Although the doc says 1.4 should be enough)

like image 191
oers Avatar answered Feb 24 '23 06:02

oers


In Eclipse:

Window > Preferences > Ant > Runtime > Classpath Tab > Ant Home Entries (Default) > Add External jars

   1.commons-net-2.0.jar

   2.oro-2.0.8.jar

It worked for me :)

like image 44
Tirthankar Avatar answered Feb 24 '23 06:02

Tirthankar