Dmitry Makovetskiyd
Dmitry Makovetskiyd

Reputation: 7053

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

Upvotes: 5

Views: 32647

Answers (4)

twister_void
twister_void

Reputation: 1389

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

Or you can select Import > General > File System from the File menu your project will imported

Upvotes: 1

Riggy
Riggy

Reputation: 1387

Assuming the folder shows up in your project Explorer, you should be able to right-click the folder, go down to Build Path and select "Use as Source Folder".

Upvotes: 1

skorks
skorks

Reputation: 4366

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.

Upvotes: 1

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 298818

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.

Upvotes: 7

Related Questions