Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.7k views
in Java FTP by (120 points)
Hi,
I'm a newbie and I'm using eclipse to create a java program, and I can't use all of the classes in the jar. Any ideas? Sorry if this is a super-newbie question.

package org.noaa.espc.nde.dhs.ftp;
import com.enterprisedt.net.ftp.*;
import com.enterprisedt.net.ftp.FTPClient;
public class TestFtp
{
FTPClient fc = new FTPClient();
FileTransferClient ftp = new FileTransferClient();
}

I get a "FileTransferClient cannot be resolved to a type" on that second to last line, I also can't import
com.enterprisedt.net.ft.FileTransferClient yet your howtocreateanftpconnection.html has this code in
it. Shouldn't I be able to use any of the classes in the jar? Thanks in advance.

2 Answers

0 votes
by (51.6k points)
Hi Louis

It sounds like you have an old version of edtftpj.jar (or even ftp.jar) on your classpath. FileTransferClient is a relatively new class (introduced in version 2.0), whereas FTPClient has been around for many years, so the fact that you can access one and not the other could be a hint that you have a pre-2.0 version on your classpath.

- Hans (EnterpriseDT)
0 votes
by (162k points)
PS you need *either* FTPClient *or* FileTransferClient - not both. FTPClient will eventually be deprecated.

Categories

...