Ant FTP Task - Unable to Create Type

Can someone help me with Ant? I want to deploy some files via FTP, but I still cannot because of the error:

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

In the 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.

+4
source share
3 answers

I assume 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 mentioned in this blogpost and in the docs (Although the document says 1.4 should be enough)

+7
source

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 :)

+4
source

If you are using a Debian Linux or Raspbian distribution on a Raspberry Pi, you can simply solve this problem by doing:

 sudo apt-get install libcommons-net-java 
-1
source

Source: https://habr.com/ru/post/1400824/


All Articles