Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import org.apache.commons.net.ftp.FTPClient

In Eclipse, the following import...

import org.apache.commons.net.ftp.FTPClient;

...produces the following error message...

The import org.apache cannot be resolved

I do not know how to import, nor where to download the import (if necessary). I might need a click-by-click set of Eclipse directions to resolve this.

like image 904
Roger Avatar asked Nov 26 '11 18:11

Roger


Video Answer


2 Answers

Steps:-

  1. Download this commons-net.jar file

  2. Extract the zip file

  3. Copy the Jar file

  4. Place the file in lib folder of your project.

  5. Right click on the project

  6. On left side of list, click on "Java Build Path"

  7. Click on Libraries tab and Click on "Add Jar"

  8. Browse the Commons-net.jar file and click on insert

like image 144
Siva Charan Avatar answered Oct 04 '22 11:10

Siva Charan


Here's the official Apache download site for Commons Net.

Once you've picked and extracted the appropriate version, set a dependency in your Eclipse project:

  • Right-click the project and choose "Properties"
  • Choose "Java Build Path" from the resulting popup
  • Set up the dependency in the "Libraries" tab.

The dependency does not need to be local to your project, but may be.

If you'd like a project-relative library, drop the jar into an appropriate project-relative location. For project libraries, choose "Add Jars" in the "Libraries" tab; for external libraries, choose "Add External Jars".

like image 41
Dave Newton Avatar answered Oct 04 '22 11:10

Dave Newton