Reputation: 7053
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
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
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
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
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