How to import from a folder in Eclipse

I want to import a Twitter class into my project.

I copied the folder to my project. this is int winterwell folder -> jtwitter folder -> twitter class.

winterwell folder is inside my project

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

+4
source share
4 answers

If it is inside one of the project’s source folders, just update 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.

+5
source

It looks like you already have an eclipse project, if you have at least one folder configured as the source folder in eclipse, if your java project matches any conventions, this folder will probably be called src on the file system. All you have to do is copy your Twitter class to any of the packages inside this source folder.

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

+1
source

Assuming the folder is displayed in the project explorer, you should right-click on the folder, go down to "Build path" and select "Use as source folder".

+1
source

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

Or you can select Import > General > File System in the File menu, your project will be imported

+1
source

All Articles