Eclipse : Importing Existing Projects into workspace - eclipse

We have a Existing project downloaded from server which was build on Maven .
(this is in the form of Folder Structure )
While import that project in Eclipse , should i use
Existing Projects into workspace
Or
File System
Please guide me
Thank you .

If you import a project into the workspace the files remain in their original locations. I do not know how to avoid this.
Often (always) I would like to have a copy of the files in the workspace and leave the project I imported it from in its original location untouched.
A frequent use-case is that I have a project and wish to make some changes to it to test out something without affecting the main project.
Thanks John

If you really have an existing project, then you must have a .project file. Check for that, and if you do have, you should use the Existing Projects into workspace option, and select the root folder of your project.
Since you have a Maven project, you could also import it as Existing Maven Projects, given that you have the Maven plugin installed in your eclipse.

File -> Import... -> General -> Existing Project into Workspace -> Select the archive file by clicking Browse button -> Select the checkbox * Copy projects into workspace. (this answers user462990's question). This way the project is copied into the workspace and the main project is not affected.
If you use "File -> Import... -> Maven -> Existing Maven Projects" you don't get the option to copy projects into workspace.

Related

Not finding libgdx projects to import them

I bought a new computer and installed Eclipse on it. After the ADT plugin finished downloading I tried to import my projects (composed of 4 sub-projects), but Eclipse doesn't see them!
I just click "import/general/import existing projects into workspace", select the folder containing the sub projects, hit the open button but Eclipse says "No projects found to import".
I'm using Eclipse Kepler and the projects files are directly taken from Eclipse Juno.
Eclipse need .project file to import the projects into workspace. what you can do is create a new project and copy the source and libraries into that project
Alternative method can be that create a new project and copy the .project file from that project to your project but make sure you edit the .project file and change the name of that project according to your project. read this for more information on .project file
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html
I will suggest you to use the First method .
Make sure that you've tried to:
Refresh everything
Searched for Nested Items
Go to (In the libg-gdx setup) Advanced >> Check Eclipse
And if that doesn't work, add a .project file into the folder manually

How do I import projects from another workspace?

I started with the default workspace C:\workspace but I mange to corrupt that by removing files so now I've created a new workspace to import the files to but I don't know how to do that. Could you tell me how I import projects from another workspace? I'm using the IBM RAD which is based on eclipse.
Thank you
Here are the steps for the original eclipse :
After switching eclipse to use the new workspace , go to File--> Import , and then choose General ---> Existing Projects into Workspace , and browse to the folder of the project that you want to import.
In Eclipse, the steps will be:
Select "File" tab
Select "Import" option in the drop down list.
Select "General" in the source listed.
Select "Archive File" if You have .zip/.rar file of the Project or "Existing Projects into Workspace" if You have Project in some other workspace.
Browse the Archive File or root directory location.
Select "Finish".
Now your project has been imported.
I am not very familiar with RAD but if its anything like Eclipse, the projects are stored by plugins. For ex: All my java related projects are stored under
workspace/.metadata/.plugins/org.eclipse.core.resources/.projects
while my other projects related to another project (Seamframework related) are stored under
workspace/.metadata/.plugins/org.jboss.tools.seam.core/projects
The best thing would be to search your
workspace/.metadata/.plugins
folder and see if you can identify all your projects. When you do, you can import them all into your new workspace as is.
To import the projects, once you locate them, follow the instructions posted by others here.
Good Luck!

Eclipse and SVN import a existing folder that has been SVN checked out

I have a folder (it also has subfolders, containing many java files) on my local hard disk.
This folder was checked out from my svn repository. I can do all the svn commands in that folder.
Now i am using Eclipse, is there a way for me to "import" that folder, and so that for all the changes I made in the Eclipse editor on those files will be reflected as well?
My question is same as How to import an already checked out svn repository into Eclipse?
BUT, the answer, I am not able to get, such as "import..." then "share...", can someone please elaborate these two steps?
If i do "import..." -> "General" -> "existing project"
BUT i don't get it, the folder i want to import is NOT an ECLIPSE PROJECT, so should i still go with this route?
or should I do "Import..." -> "General"-> "file system"? but it requires me to create a project first in eclipse, so i don't think i should go that path
here is what i awant to archive at the end
1. For the folder i want to import, i want to be able to do all the svn stuff, such as commit, update,etc
2. the file i edit in the eclipse, should be the same file in the folder i checked out from svn
please help....
"import..." -> "General" -> "existing project" (Browse for the project which u have checked out into ur local hard disk)
then in that window down there is a checkbox to select "copy projects into workspace" => uncheck this option.
this will have project in Eclipse and local existing folder that has been SVN checked out where u can
1. For the folder u want to import, u want to be able to do all the svn stuff, such as commit, update,etc
2. the file u edit in the eclipse, should be the same file in the folder u checked out from svn.
cheers.. this will work!!
For anyone that has tried all of the suggestions dealing with importing projects and find that it still doesn't work, you may have a mis-configured connector.
Go to Window -> Preferences -> Team -> SVN -> SVN Connector. Make sure the version of the SVN Connector matches the version of SVN you have checked out the code with.
For example, if your connector is configured for svn 1.7.x, and the source is checked out with 1.8.x, then Eclipse will not recognize your SVN repository. If you don't have the right SVN Connector version installed and can't convince Eclipse to install it automatically, you might want to go to the SVNKit web site for further instructions.
Once you have the proper SVN Connector specified, go back and try to Share Project (or Share Projects), or remove and re-import the existing projects.
I was able to "import" a folder without .project-file:
File -> new -> Project... -> General -> Project
Then you have to chose the Location (untick "Use default location" and press the "Browse..." Button):
Press "Finish" and you get the Project in eclipse with SVN History. Also eclipse adds the ".project" file.

Should renaming a project in Eclipse also rename project folder on file system?

Should renaming a project in Eclipse also rename project folder on file system ?
My project file system name remains the same even when I rename the file on Eclipse.
Should I manually rename the project on the file system to same on Eclipse ?
It appears that renaming a project will only rename the underlying filesystem directory if the project was created with the "Use Default Location" checkbox selected (meaning the project is created in the workspace directory). If you create a project and specify a custom location outside the workspace, renaming that project in Eclipse does not rename the project's host directory. In that case, you'll probably want to:
Rename the project in Eclipse (which will update any internal references and the .project file)
Remove the project from your Eclipse Workbench view (making sure that the "Delete file contents" option is NOT selected in the delete confirmation dialog).
Rename the project's directory in your filesystem.
Import the project back into your Eclipse workspace.
I was surprised to learn this (I tested it with Eclipse 3.7), but it seems to be logical to me. The idea is that projects in the workspace folder are considered to be "under Eclipse control" as opposed to projects that are located in arbitrary places on your filesystem.
Use Refactor to rename the project name. It will rename the file/folder in filesystem as well.
Menu -> Refactor -> Move... (Shift + Alt + V).
In this window you can change name of the folder name and also change the path completely.
If the folder name is important, then change it manually. Keep in mind that you will have to re-open or re-import the the project into eclipse. After you rename the folder, Eclipse won't know where to find it.
In Eclipse Oxygen (4.7) the Move option is greyed and renaming the project does not rename the directory. However, if you switch to the Navigator view (may need to find it under Window > Show View > Navigator) the Move option will be available and it will rename the project's directory.
This is a lot faster than having to recreate the project or re-import it.
If your project is a Maven project to rename, do steps as followed:
Open Context Menu on your project > Refactor > Rename Maven Artifact.
Change Group or ID.
Check "Rename Eclipse project in Workspace".
press OK button.
Update maven project by Context Menu > Maven > Update Project.
Using eclipse Neon 4.6.3, renaming does not work. You will have to do what E-Ritz said in his answer.
It is also worth mentioning that if you are importing a project as a Maven project (via Import... -> Existing Maven Projects), the project name will be taken from the pom.xml rather than the folder. So you should also change the <name>my-project-name</name> part of the pom

How to convert IntelliJ project to Eclipse?

I have one IntelliJ project and I want to open it in Eclipse, so what should I do?
There is an export to eclipse option in Intellij Under file menu.
This option will generate you the necessary .project and .classpath files that will be used by eclipse. Personally, I would remove any IDE dependencies using some dependency management systems like Maven or Apache IVY. ( Is system the right term?)
I had the same issue and (I don't have Intellij) but doc_180's comment pointed me in the right direction. Here is a simple solution. In Eclipse create a new blank Android project. Copy the .project and .classpath files and the .settings folder to the Intellij folder. Edit the .project file and change the name of the project.
You should now be able to Import the project in Eclipse by right clicking and selecting "Import->Existing Project into Workspace".
I see this is an old question, but thought I should add this answer for others Googling it like me ;)
Without access to IntelliJ to export and convert the project, try the following.
In STS or Eclipse create an empty project first, then, select File -> Import and choose General -> File System. In the resulting dialog box, select the root folder of the IntelliJ project as source and the empty project as the destination.
For unit tests, add the test folder as a source folder to the build path (right-click on the folder, select Build Path -> Use as Source Folder).
The projects I import this way run without any further modifications, including the tests.
Eclipse and Intellij create different project structure each other (Output path, Source Code etc...). You can export the current project to Eclipse environment.
File -> Export -> Project to Eclipse