最近项目上要用到ftp上传功能,就自己在window上搭了个FTP服务器,结果在获取ftp文件列表的时候卡住了,一直在报错:
java.lang.ClassNotFoundException: Didn't find class "Windows_NT" on path: DexPathList[[zip file "/data/app/com.ftp-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
找了好久也没有发现问题在哪,设置了很多东西都不行:
ftpClient.listFiles(new String(path.getBytes("GBK"),"iso-8859-1"));
ftpClient.changeWorkingDirectory("FTP_Inspection");
ftpClient.enterLocalPassiveMode();
ftpClient.setControlEncoding("UTF-8");
FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_NT);
config.setServerLanguageCode("zh");
发现都没有效果!
最好下了最新的jar包,好了!悲催啊!
原来的jar包是commons-net-2.2,现在的是commons-net-3.3!
2.2的jar包
http://download.csdn.net/detail/gufeilong/9088057
3.3的jar包
http://download.csdn.net/detail/gufeilong/9088061
希望能帮到你!