I am getting this error when trying to run my test program:
[root@tux tmp]# java testit
Exception in thread "main" java.lang.NoClassDefFoundError: com/enterprisedt/net/ftp/FTPClient
this is how im compiling it and it does this fine:
[root@tux tmp]# javac -classpath /tmp/edtftpj-1.4.1/edtftpj-1.4.1.jar testit.java
here is my code:
import com.enterprisedt.net.ftp.*;
import com.enterprisedt.net.ftp.FTPException;
import com.enterprisedt.net.ftp.FTPClient;
import com.enterprisedt.net.ftp.FTPTransferType;
import com.enterprisedt.net.ftp.FTPConnectMode;
import java.io.*;
import java.util.*;
import java.lang.*;
import java.net.*;
public class testit {
public void main(String[] args) {
System.out.println("Setting Variables");
String host = "xxx.xxx.xxx.xxx";
String user = "xxx";
String password = "xxx";
String filename = "dead.letter";
String directory = "/home/xxx";
try {
FTPClient ftp = new FTPClient(host, 21);
ftp.login(user, password);
ftp.setType(FTPTransferType.BINARY);
System.out.println("Binary mode set");
ftp.setConnectMode(FTPConnectMode.PASV);
System.out.println("Connection mode set to PASV");
ftp.chdir(directory);
byte[] buf = ftp.get(filename);
System.out.println("Got " + buf.length + " bytes");
ftp.quit();
} catch (IOException ex) {
System.out.println("Caught exception: " + ex.getMessage());
}
catch (Exception ex) {
}
}
}
does anyone have any clue why it compiles but does not find the classes at run time.