How can I open this Spring project in Eclipse? - java

Silly question, cant seem to get it to work.
https://spring.io/guides/gs/rest-service/ mentions a Java project - available here on GIT - https://github.com/spring-guides/gs-rest-service.git and here directly - https://github.com/spring-guides/gs-rest-service/archive/master.zip .
When I try to import the zip, it fails. I tried to unzip and import selecting the root folder at source and it won't work.
How can I open this project in Eclipse and make my own changes?
Thanks.

Ensure that you are selecting "Existing Maven Project"
File > Import > Maven > Existing Maven Project
Point to the inflated directory and choose the pom.xmls

With Eclipse Neon, File > Open Projects from Filesystem... , select Archive and give location of your zip, click Finish.

Related

Eclipse : Import maven project into current workspace location

Would you guys, please tell me how to import the existing maven project which we have copied from different user into my local and wanted to imported into new workspace not just project view vis but the content of project classes and pom.xml need to copy physically into my new workspace directory.
Means, if my current workspace location is : C:\ALL-PROJECTS\New-Project\ and my copied location of that project isC:\Downloads\Copied_Project\ so, i wanted to copy all code from copied loc : Copied_Project to my current workspace location : New-Project
So that in future i will going to keep one copy of it, going to delete copied location. And that will be more manageable in future onces we have many projects like this.
File > Import > General > Existing Projects into Workspace
Click Next
Select root directory of project
Check project in Projects lists and check option Copy projects into workspace
Click Finish
Just copy that project to ur project location and import that from same location
You can import as usual but you have to leave all the meta data like .classpath and .project etc files because you changed the location of your project so these files having the physical location path which is already changed by you. So it will not work.
Else you just searched the old location inside all the files and replace with location and import into eclipse or IDE.
Your best bet for copying projects between different Eclipse workspaces is to export the project as a jar file
You can then take that exported project .jar file and import it into your new workspace using the Import Existing Projects into Workspace and selecting your archive (.jar) file
I don't know about other IDE But in eclipse this is how it is done
copy the project folder into your workspace folder
Make sure the project folder has pom.xml immediately under it .
open eclipse . your copied project will not be found unless you import it .
So Go to
File->import->Maven->Existing maven project
Then choose your project folder from explorer and follow the procedure your IDE takes you through
Finally right click on the project Go to maven->update project

Unable to import recently moved project into Eclipse

My project was created and worked on under the Download directory but then I moved it to C: root directory.
Now when I open Eclipse and do File > Open Projects from File System it doesn't import the project at all. There is no error, it just doesn't show anything.
I am sure Eclipse is pointing to the new workspace.
Could it be that the project itself has some sort of reference to the old directory?
You can try File > Import > General > Existing Projects into Workspace instead.

Opening project files in eclipse

I am unable to open certain project files in eclipse. The error message says that the Project Description file(.project) is missing. However if I open up the folder using windows explorer, I am able to see the .project file. I am not sure how to resolve this, hope someone can advise. Thank you.
Try to import manually the project in the workspace by doing:
File -> Import -> General -> Existing Projects.
Then select the root directory of your project.
After that it should be configured correctly

Import Java project from GitHub to Eclipse

I'm trying to import a project on GitHub into eclipse because there are a few things I want to add to it. However whenever I add it I get a ton of errors and problems with it...
The GitHub project is https://github.com/dmulloy2/SwornGuns
I've tried adding it to eclipse and it didn't work. I then tried making a project in eclipse and then put the files in, that didn't work. I also read online that going to Configure -> Convert to Maven Project would work, and then importing the spigot.jar file that this source depends on. However that didn't work and just gives me a ton of import errors.
The errors I am getting:
That project is a maven project. A simple way is clone that project into your machine, and import it as a maven project, with File - Import - Maven - Existing Maven Project.
Eclipse will help you resolve the pom file and configure project and download necessary libs.
First, make sure you are using Luna, the most recent version.
In eclipse, File > Import > Git > Projects from Git > Existing Local Repository.
In the Import Projects from Git screen, click add, then goto the location of the cloned repository. Click open, finish, then next. Select Java > Java Project, and click next again.
At this point, there are three options.
Import existing projects
Use the New Project Wizard
Import as General Project
Pick "Use the New Project Wizard". Then, uncheck "Use Default location", and click browse. Select a folder (You probably want the location you cloned the repo to), click "Open", and give the Project a name. Click next, and make sure that the src/bin folders are setup correctly, and click finish.
Whew!
Of course, the Import from Git option was only added in Luna, so update eclipse if necessary.

Can you import a non-archive project directory in Eclipse?

I read this article which shows how to import/export projects in Eclipse (although it seems a little outdated and I'm using 3.7 Indigo).
To export a project, you go to File >> Export and it creates some kind of "project archive" file on the local file system. You could then email it to someone else, who could then import the archive as a new project or into an existing project.
But what if you don't have an "archive" file to begin with?!? What if you just have the project files and directories but without all the Eclipse-metatdata (.project file, etc.)? Is there anyway to tell Eclipse to look at, say:
/home/myuser/some/path/to/project/root/
src/main/java
SomeObject.java
build.xml
...and get it to read that as a new Java project?
Try the steps below:
Create a Java Project in Eclipse as below:
Load the project contents from your file system as below:
Hope this works for you.
.project and .classpath files are the base of the project structure. Without a .project file Eclipse won't recognize your project. The .classpath is important too but that one changes between environments. Should you use the files from another environment you'll have to reconfigure some settings.
Rather than emailing code, I suggest you use a Version Control system and, also, some Eclipse plugins. SVN + Subclipse for example.
If you trully want to send the project to another person just send him the project's folder and import it as an existing project by doing right click on the project explorer and selecting Import > Existing Project into workspace.

Categories