简体   繁体   中英

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

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.

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.

假设文件夹显示在项目资源管理器中,您应该能够右键单击该文件夹,转到“构建路径”并选择“用作源文件夹”。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM