Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import from a folder into Eclipse

I want to import a class Twitter to my project..

I copied a folder to my project. it is int winterwell folder>>jtwitter folder>> Twitter class.

the winterwell folder is inside my project

I downloaded a jar file called jtwitter, unpacked it and tried to put it as a folder.. into eclipse. I dont know what is easier to import a jar file or import it as folders.. any method will solve my problem

like image 890
Dmitry Makovetskiyd Avatar asked Apr 19 '11 12:04

Dmitry Makovetskiyd


2 Answers

If it's inside one of the project's source folders, just refresh the folder.

Otherwise, right-click the project, then select Build Path > New Source Folder ...

Or you can select Import > General > File System from the File menu.

like image 89
Sean Patrick Floyd Avatar answered Sep 29 '22 17:09

Sean Patrick Floyd


It sounds like you already have an eclipse project, if so you will have at least one folder set up as a source folder in eclipse, if your java project is following any kind of conventions this folder will probably be called src on the filesystem. All you need to do is copy your Twitter class into any of the packages inside this source folder.

Alternatively you can add your new folder (jtwitter) as another source folder for your project will effectively achieve the same result.

like image 24
skorks Avatar answered Sep 29 '22 17:09

skorks