?
Solved

Import the Class Library

Posted on 2003-03-31
5
Medium Priority
?
546 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:garypingkei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:antons061400
ID: 8243298
You need to read some tutorial about Java.
0
 

Author Comment

by:garypingkei
ID: 8243343
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.
0
 
LVL 4

Expert Comment

by:antons061400
ID: 8243485
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


0
 

Author Comment

by:garypingkei
ID: 8250705
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 ?

0
 
LVL 4

Accepted Solution

by:
antons061400 earned 80 total points
ID: 8251190
you simply copy the directory structure com\.... to the c:\myjava. so you will have something like c:\myjava\com\...

Note: The directory structure com/... reflescts statement package com.enterprise.net.ftp;

Note: In your classpath you mast have all libraries you want to use so something like

java -cp c:\myjava;c:\ftp-1.2.1\lib\ftp.jar com.enterprise.net.ftp.myftp

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question