Eclipse插件Ant里运用ftp遇到的问题
2016-03-10 00:00
447 查看
用Eclipse4.2+Ant1.8.4,在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
下载地址: http://mirrors.cnnic.cn/apache//commons/net/binaries/commons-net-3.2-bin.tar.gz
http://archive.apache.org/dist/jakarta/oro/binaries/jakarta-oro-2.0.8.zip
把这两个包放到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. ”
“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
下载地址: http://mirrors.cnnic.cn/apache//commons/net/binaries/commons-net-3.2-bin.tar.gz
http://archive.apache.org/dist/jakarta/oro/binaries/jakarta-oro-2.0.8.zip
把这两个包放到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. ”
相关文章推荐
- java中获取文件路径的几种方式
- Struts2权限控制
- eclipse 设置启动时选择打开工作空间 删除无用工作空间
- Java操作数据库的元数据
- ECLIPSE取消自动更新
- Java 1.5中显示数组
- Eclipse launch configuration----Eclipse运行外部工具
- 怎么看java程序的运行时间
- Java 多态
- java你可能不知道的事(2)--堆和栈
- spring bean生命周期
- Eclipse中使用recyclerview时出现Caused by: java.lang.NoClassDefFoundError: android.support.v7.recyclerview.R$styleable
- java二叉树实现、遍历、求深度
- java你可能不知道的事(2)--堆和栈
- java你可能不知道的事(2)--堆和栈
- java你可能不知道的事(2)--堆和栈
- Spring中的Bean定义
- Spring分布式事务实现
- 005.Java中switch语句能否作用在byte上,Long呢? String呢?
- 关于VO、PO的理解——java的(PO,VO,TO,BO,DAO,POJO)解释