Creating an Eclipse Java Project from an Existing Directory Structure and Source

If you are keeping your code and configs in a repository, more likely than not (and it is recommended) that you do not also store your IDE specific configurations or files within the repo.

As such, you will only keep the bare minimum of IDE independent files in your repository and when you check out a copy of it you will have an existing set of directories and files that you will use to create a project with in Eclipse.

To create a new project in Eclipse using the existing directory structure, do the following:

  • In Eclipse go to: File/New/Project
  • Select “Java Project”
  • Un-check “Use default location” and then click Browse and navigate to the top level directory with contains your source, libs, configs, etc.
  • Eclipse will display a warning that says that your project “overlaps the location of another project”.
  • Making sure that the “Location” field now contains the path to your source directory, RE-check the “Use default location” checkbox and now Eclipse will let you click on the “Next” button to continue configuration of your project.

Leave a Reply