Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create shared source folder across multiple projects in Eclipse?

I've been looking at the Android + App Engine source code from a Google IO session (Android meet App Engine). They generate three projects, an Android project, a GWT interface, and an App Engine server project. All of these projects have a common source folder called shared where they can put their synchronized data classes that all parts of the app need to know about.

I'm wondering how to create that shared source folder in a general Eclipse project. How can I create a source folder in one project that's also available to and synced with other projects in Eclipse?

Edit
I'm not looking for how to do an Android Library project (I already use several of those for my apps). Android Libraries don't work for a general eclipse project, say an App Engine server side project.

like image 648
CodeFusionMobile Avatar asked May 31 '11 14:05

CodeFusionMobile


People also ask

How do I add multiple projects in Eclipse?

If all of your old projects exist in a single directory or in a single parent directory, you can do File -> Import... -> Existing Projects into workspace. Choose a root directory that is a parent all of the projects you want to import. You will then be able to import all of the projects at once.

How do I group a project in Eclipse?

But you can group Projects into named Working Sets. On the Package Explorer or Project Explorer view menu, you can use Top Level Elements -> Working Sets and use Configure Working Sets.../Select Working Sets... to organize your Projects into folder-like groups.

What is use as source folder in Eclipse?

A source folder is marked by Eclipse as containing java sources. Then, when you compile your project Eclipse will look for your source code into all your source folders. You can make any folder become a source folder adding it to the java build path.


1 Answers

I am using Helios eclipse.

To create Source Folder

Navigate to your project in the package Explorer, right-click and select New, select Source Folder. Enter the folder name and click Finish.

If you want to use the source folder in any of your projects, then go to your project properties, click Java Build Path, go to Source tab, you can link the folder.

like image 141
Sunil Kumar Sahoo Avatar answered Sep 29 '22 06:09

Sunil Kumar Sahoo