Eclipse插件Ant里运用ftp遇到的问题

本文解决了一个在Eclipse3.3环境下使用Ant1.7.0进行FTP部署时出现的问题,错误提示为找不到FTPClientConfig类。通过正确设置ANT_HOME环境变量,并手动添加jakarta-oro-2.0.8.jar和commons-net-1.4.1.jar到Eclipse Ant模块中,最终解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

用Eclipse3.3+Ant1.7.0,在build.xml文件中使用ftp将包发到远程服务器上时总是出错,出错信息为:

“Could not create type ftp due to java.lang.NoClassDefFoundError:

                                  org/apache/commons/net/ftp/FTPClientConfig”

结果Google了N久,知道是少了两个包:commons-net-1.4.1.jar和jakarta-oro-2.0.8.jar

把这两个包放到Eclipse的Ant的lib目录下,在Eclipse重新执行ant,问题依然存在。结果又Google了很久,最终,在一篇外国博文 中找到解决方法,原文如下

“I had the same error message, but only in Eclipse (version 3.3).

  I did not get the error on command line. I had setup up ANT_HOME variable correctly and copied the jakarta-oro-2.0.8.jar and commons-net-1.4.1.jar to %ANT_HOME%\lib

  However it seems that the ANT Eclipse module does not automatically parse the %ANT_HOME%\lib directory for new jars and I had to add them manually

  preferences->Ant->Runtime, Classpath tab, Ant Home Entries -> Add External JARs...

  Then it worked. ”

原文出自:http://www.coderanch.com/t/109020/Ant-Maven-Other-Build-Tools/NoClassDefFoundError

转载于:https://www.cnblogs.com/mikelin/archive/2010/04/03/1703886.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值