Link to home
Start Free TrialLog in
Avatar of garypingkei
garypingkei

asked on

Import the Class Library

Hi all experts,

I downloaded a java FTP client library from enterprisedt.com. But I don't know how to import it to my j2sdk 1.4.1 library. The doc of this distributor show me that it can use the code likes :

package com.enterprisedt.net.ftp;

import com.enterprisedt.net.ftp.FTPClient;

But it, I may be have some mistake here, is not successful. Could anyone help me ?  

Thanks

Gary
Avatar of antons061400
antons061400

You need to read some tutorial about Java.
Avatar of garypingkei

ASKER

To antons,

Yes. You are right. I am a beginner. So I am reading a book call Teach yourself Java 2 in 21 days. I read to day 7 talking about applet.

But I really interest in writing a FTP client using java, may be you are also have this stage a long time before. It is something you want to do but you don't know much. I let, may be, it be a pressure to develop myself quickly.

Anyway, thank for your advice and would like to have more your comments on this issue, since I think it is just a easy questions in your knowledge.
I'm sorry, that I was intolerable to you.

The question is easy, but answer is complicated. Hard to say where to start.

The recomendation for tutorial is OK I think. Something like http://java.sun.com/docs/books/tutorial


to your current code, you just post

package com.enterprisedt.net.ftp;
import com.enterprisedt.net.ftp.FTPClient;

can be compiled, if your class with this code is in the directory com/enterprisedt/net/ftp and the ftpclient.jar is the requested library you can start the compilation like
CLASSPATH=$CLASSPATH:ftpclient.jar
CLASSPATH=$CLASSPATH:.

javac com/enterprisedt/net/ftp/*.java

or on windows platform
set CLASSPATH=%CLASSPATH%;ftpclient.jar
set CLASSPATH=%CLASSPATH%;.

javac com\enterprisedt\net\ftp\*.java


To : antons,

Hey..friend..You are not intolerable me...Nice to meet you here.

From your help..I understand now..Sound like something set path in DOS and I can compile my code properly. But I have another problems. As now, my class is inside c:\ftp-1.2.1\src\com\enterprise\net\ftp, so I run it like :

java -cp c:\ftp-1.2.1\src com.enterprise.net.ftp.myftp

**(myftp is my class name)

if I want to put my class into c:\myjava\ instead, how can I run then ?

ASKER CERTIFIED SOLUTION
Avatar of antons061400
antons061400

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial