How to make an existing directory into an eclipse project

前端 未结 10 912
[愿得一人]
[愿得一人] 2020-12-04 10:52

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 havi

相关标签:
10条回答
  • 2020-12-04 11:26

    In the New Java Project wizard, uncheck the checkbox that says Use default location and the use the Browse button to find your directory.

    0 讨论(0)
  • 2020-12-04 11:30

    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.

    0 讨论(0)
  • 2020-12-04 11:33

    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:

    1. In one of the navigation views, right-click the project or folder where you want to create the linked folder.

    2. From the pop-up menu, select command link New > Folder.

    3. 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.

    4. Click Advanced.

    5. Check Link to alternate location (Linked Folder).

    6. Enter a file system path, or click Browse to select a folder in the file system.

    7. Click Finish.

    0 讨论(0)
  • 2020-12-04 11:33

    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.

    0 讨论(0)
  • 2020-12-04 11:35

    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.

    0 讨论(0)
  • 2020-12-04 11:37

    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?

    0 讨论(0)
提交回复
热议问题