How to make an existing directory into an eclipse project
EclipseEclipse Problem Overview
I have a project I am working on. I have decided to try working with it in Eclipse. There is already a directory, under version control where all the code resides. I am having a rather strange problem. I cannot find any way to just start using an existing code directory as an eclipse project. All I can find is how to import existing source into a new project or check out source from version control into a new project. How do I make an existing directory into a project?
My project is a Django web app if it is any help
Eclipse Solutions
Solution 1 - Eclipse
In the New Java Project
wizard, uncheck the checkbox that says Use default location
and the use the Browse button to find your directory.
Solution 2 - Eclipse
It is pretty easy to do. Go to File->New-> Project. In the Project wizard, choose the type of project you want and then be sure to unclick the 'Use default location` checkbox. Browse for your folder in the widget that then becomes enabled. Click finish after that.
Alternatively, you could create a brand new project workspace in a new location. Then, assuming Java as your project type, you can open up your project properties and add as a source folder your existing directory. To do this, use the 'Link Source' button on the Java Build Path -> Source tab of your Project Properties dialog.
Solution 3 - Eclipse
My Method:
I clone this file to new project directory , and rename Project-Name to my project name, after that i import new files and directory from Eclips
File Name: .project
( Use Notepad for make this file...select Save as type to All Files (*.*)
and write file name like: .project
)
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Project-Name</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Solution 4 - Eclipse
Probably not the way most people would go about this, but I like all of my eclipse projects in one place but don't necessarily have my source in my workspace directory. Maybe there is a built in way to "symlink" in eclipse, but I sometimes end up with the project folder in the workspace, with the "src" symlinked to the actual source directory somewhere totally different. That's my personal preference anyway. If you too are on a *nix machine a simple
ln -s /path/to/source src
will do from your project directory.
Solution 5 - Eclipse
Hope this link answers the original question of this thread.
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-45.htm
Creating linked resources
Folders and files can be linked to locations in the file system outside of the project's location. These special folders and files are called linked resources.
To create a linked folder:
-
In one of the navigation views, right-click the project or folder where you want to create the linked folder.
-
From the pop-up menu, select command link New > Folder.
-
Specify the name of the folder as it will appear in the workbench. This name can be different from the name of the folder in the file system.
-
Click Advanced.
-
Check Link to alternate location (Linked Folder).
-
Enter a file system path, or click Browse to select a folder in the file system.
-
Click Finish.
Solution 6 - Eclipse
You know, it is not so simple question. Depending on your project type (jar, web module, ear and so on) different structure and configuration files are used by eclipse. So the first really interesting question is that what is your project type? The basic solution after it to create a new project, and define the directory of your source code as project root. Then you will see what else to change (for example source path settings, classpath and so on). So how does your project look like? Can you proide structure tree of folders?
Solution 7 - Eclipse
Since you are using Django you should first set up PyDev in Eclipse. You can install it from the market. Then you want to configure the PyDev Python interpreters to find your installation of Django (http://pydev.org/manual_101_interpreter.html). Make sure to provide the explicit path to the Django folder if your Django is not installed in the default location.
Once these things are ready you can select File > New > Other, then select PyDev Django Project from the PyDev sub directory.
Click next and here is the sweet part: Uncheck 'Use default' (as previously stated) and then find your Django project directory. Be sure to select the right project folder (ie: the folder that contains manage.py
). When you have the right folder selected Eclipse/PyDev will recognize that a project already exists and make mention that it will use those files. Click Finish.
Then there is a DB form that asks about your DB settings. If you already have a settings.py
file then this seems to make no changes (as it should not). So fill it in or don't. But this is the last step.
Then you should be able to view and use your existing project in Eclipse!
Solution 8 - Eclipse
I just created a pom.xml by hand and imported the project as an existing Maven project in Eclipse. It even works for nested projects without problems.
Solution 9 - Eclipse
Use "import - existing projects into workspace". This works for my case.
Solution 10 - Eclipse
Right click on a project -> Properties. Open project location in explorer, there's a little icon next to path. Put your folder/file structure in there and refresh the project in eclipse.