Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.

compilation problems

no avatar
User

cryptik

Posts

6

Joined

Thu Jul 08, 2004 2:34 pm

compilation problems

by cryptik » Fri Jul 09, 2004 2:39 am

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.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: compilation problems

by support2 » Fri Jul 09, 2004 7:13 am

no avatar
User

cryptik

Posts

6

Joined

Thu Jul 08, 2004 2:34 pm

I did just not on that example

by cryptik » Fri Jul 09, 2004 7:59 am

[root@tux /]# java -classpath /usr/java/j2sdk1.4.2_04/jre/lib/edtftpj-1.4.1.jar testit
Exception in thread "main" java.lang.NoClassDefFoundError: testit
no avatar
User

cryptik

Posts

6

Joined

Thu Jul 08, 2004 2:34 pm

verbose compile

by cryptik » Fri Jul 09, 2004 8:02 am

it does load the class files in not sure why it does not run
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: verbose compile

by support2 » Fri Jul 09, 2004 8:06 am

no avatar
User

cryptik

Posts

6

Joined

Thu Jul 08, 2004 2:34 pm

example

by cryptik » Fri Jul 09, 2004 8:13 am

no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: example

by support2 » Fri Jul 09, 2004 8:26 am

no avatar
User

cryptik

Posts

6

Joined

Thu Jul 08, 2004 2:34 pm

WOOOOOHOOOOOO

by cryptik » Fri Jul 09, 2004 9:35 am


Who is online

Users browsing this forum: No registered users and 14 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign