Where is "create project from existing source" in eclipse Indigo?
Asked Answered
V

4

37

I cannot find "create project from existing source" in Eclipse Indigo while I am trying to create a "java project". When I select Java project and then next window comes up with options- User default location, JRE, Project layout, and Working sets.

I couldn't find a clue while searching for any possible change in UI of Indigo. Where can I find "create project from existing source" in Indigo?

Vachon answered 29/4, 2012 at 1:9 Comment(2)
How about linking the old source folder to the new project?Psychopathy
You can just copy your source into the src folder and use "Refresh" on it. :/Desdemona
V
42

Un-check the Use Default Location option and then Browse to select the parent folder of your existing source tree. Eclipse will automatically detect the existing files and folders, although you might have to configure the project to let it know what your source folder is; but the New Java Project wizard presents that option to you.

Vickievicksburg answered 29/4, 2012 at 2:36 Comment(2)
Eclipse complains that the folder overlaps the location of an existing project (even though it's just a plain source tree) and refuses to proceed.Zirkle
This fixed the problem for me, but it's funny that it didn't allow me to place the files inside the Default Location. Had to place them somewhere else in order to do thisEncampment
Z
4

If your source directory is inside the current workspace, ERiz's answer won't work due to a bug in Eclipse. (It prints out the error "folder overlaps the location of an existing project"). Instead, you should leave Use Default Location checked and type in the name of the folder as your project name.

See here for more discussion about the problem.

Zirkle answered 12/8, 2012 at 16:20 Comment(1)
That's not a bug, it's how Eclipse workspaces work. Eclipse won't let you nest a project inside another project, so trying to create a project under another in your workspace isn't allowed.Vickievicksburg
S
2

So far it seems the only way to do this is the solution Antimony suggested.

If you want to avoid typing in the folder name, untick "Use default location", select your source directory, then tick "Use default location" again and the Project name field should contain the name of the source directory.

Sew answered 14/8, 2012 at 16:9 Comment(0)
W
1

I came across this answer trying to import a Git project, so I will write my solution here. The workspace directory is the same as the Git's working directory, so I didn't want to move the project folder somewhere else.

If you have a Git project you want to import, but Eclipse can't see it because it has not the .project file in its directory, here's the steps:

  1. File > New > Java Project: put in the name the name of the project's dir, so as Antimony said, the project will be automatically configured.
  2. You will see your project in the Project list, but it's not bound to Git yet.
  3. If it's a maven project, you can convert it to maven project now: right click on the project and select Configure > Convert to Maven project.
  4. Delete the project (DO NOT SELECT "Delete project from disk")
  5. Now you can import the project as a Git project from File > Import > Git Project
Whilst answered 18/2, 2013 at 10:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.