GCJ compiled binary throws FTPConnectionClosedException randomly, which I think is caused by an inappropriate BufferedReader.readLine() response in __getReply() [org.apache.commons.net.ftp.FTP]. no problem with Sun Java. download the demo codes: http://www3.emu-zone.org/host/mameplus/temp/bug.zip buildme.sh, the build script ftp.java, original example from org.apache.commons.net.ftp PrintCommandListener.java, original event listener Downloader.java, slightly modified ftp.java DirList.java, recursively list directory apache package from http://cvs.apache.org/builds/jakarta-commons/nightly/commons-net/ http://apache.sunsite.ualberta.ca/jakarta/oro/source/jakarta-oro-2.0.8.tar.gz