Trying to move GIT Project from IntelliJ IDEA to Eclipse with EGit? - java

My firm is making me move back to Eclipse and I am trying to move GIT Project from IntelliJ IDEA to Eclipse with EGit?. The issue I am having is that I access my project from the command line with the following command:
git clone git#git:common.git
That's how I clone it and then I just work in IntelliJ without a issue, In Eclipse with EGit I am getting the following screen and every setting I am trying down work
Can someone please tell me based on the command line what options I should be using.. thanks

I've always had problems cloning via EGit. Here's what works for me:
Clone via the command-line as usual.
Create or import your project into an Eclipse workspace.
Right-click the project in the Navigator or Package Explorer.
Team > Share Project > Git > Next.
Since there will already be .git repo there, select 'Use or create repo in parent...".
Finish. Give it a few seconds and you should see your project files decorated with Git repo information.

Related

Netbeans importing projects from github

I am trying to build this demo program (github and website below) in netbeans. I cannot seem to get it to run properly. How do i go about importing both SQLInject and SQLInject1?
SQLInject1 gives errors regarding build.xml ant files.
How do i create these projects in netbeans properly?
https://www.javacodegeeks.com/2012/11/sql-injection-in-java-application.html?fbclid=IwAR10XX-PWMdRdhyQfce_613kmhszUZxj_gyg3h_0VJmY1dgXEAss8Ksuhcc
https://github.com/ramkicse/Sql-Injection-in-Java
First, install git. You can do that here: https://git-scm.com/downloads
Then, clone the desired repository. You can do this by opening a git Bash shell and executing this command:
git clone <the repository here>
For example:
git clone https://github.com/ramkicse/Sql-Injection-in-Java.git
Then, open the project in NetBeans. This can be done by following the "Setting Up a Java Project Based on Existing Sources" instructions described here.

Git Project won't run locally on Eclipse

So I'm having trouble running my git repo locally. I had been running it fine in the past but after some errors I needed to re-clone the repo. Since then I have not been able to run my program. I can still edit and push/commit but just can't run it locally.I believe it might have to do that Eclipse is not recognizing it as a Java Project. If I try to right click the project and configure, the only available options are: "configure and detect nested projects" or "convert to Maven Project
Package Explorer View
If I try to run it is just not recognizing the project at all. If I go into run Configurations and select Java Application, the project is able to be found.

build error after importing maven projects

I cloned one of the open source git repositories and was trying to import it as maven project in eclipse. After I imported everything as a maven project, whole package is getting messed up. See the below error:
How can I fix this issue so that I can build it on my local box? I cloned the same git repository locally on my desktop.
I am using eclipse version:
Eclipse IDE for Java Developers
Version: Luna Service Release 1a (4.4.1)
Build id: 20150109-0600
Steps I have tried already:
I have already tried maven->update project.
I have also tried removing and adding it again.
I tried mvn clean install both on command line and eclipse, they are successful as well.
Can anyone help me with this? If needed, you can also clone it and try importing it to see whether it works for you or not.
The root of your problem is that the build section of the pom.xml for that project specifies:
<sourceDirectory>./src</sourceDirectory>
Eclipse uses the sourceDirectory tag to tell it where the root of the main sources are. If you change that to ./src/main/java, then right-click on the project > Maven > Update Project... and click Ok (I had to do this twice) it will fix the Eclipse classpath so Eclipse can build the project. You can then revert the pom back to the head revision and so long as you don't run Update Project again it should continue to build.
I'm unclear on why that project specifies a non-standard source directory but uses the standard Maven layout, but this should at least get you into a working state within Eclipse.

How to configure a project imported from GIT to be a Java project in Eclipse?

I've imported a project from Git in Eclipse using this method:
File > Import > Git > Projects from Git > Next > Clone URL .
At this point I inserted the URI like this https://github.com/mygituser/My-Project .
Then my user and password, and the project was imported.
The problem is that Eclipse didn't recognize it as a Java project, and I really don't know why.
As consequence, I can't see errors or warnings on my project and neither use autocomplete, I'm getting this message "This compilation unit is not on the build path of a Java project".
Also, right click on My-Project > Build path shows the message "No actions avaliable".
If you need more information to help me, could you ask me on comments, please?
I appreciate your attention!
Most people don't include build files in repositories, only source. What you need to do is create a new Eclipse project the create a Git repo on top of that:
Create a new Eclipse project, and go to it with your terminal.
git init to initialize a repo.
git remote add origin https://github.com/mygituser/My-Project to add the remote.
git pull -u origin master to pull the changes.
Also, make sure that when you commit, you don't add build files that the author kept out. You can do this via a .gitignore file. Simply take this file and add it to your project directory.
This method applies to most Git repositories, as build and compiled files are usually left out.
Note that this method requires that you install Git for command line (or Git Bash). You can get Git at their website.
Since you already have the source code downloaded from the git repository, you should be able to create an Eclipse project from the existing source code.

Trouble creating Eclipse/Java projects from Git repo

I am brand new to Git and EGit. I have been asked to troubleshoot a project stored in a Git repo located at http://com.myorg.gitrepo/githome/myapp.git.
First I tried just doing this on the Git command-line. From a terminal, I executed:
git clone http://com.myorg.gitrepo/githome/myapp.git myapp
The command was successful and I can now see a project checked out under /home/myuser/myapp (I'm on Ubuntu 14.04).
Now I'm trying to load the checked out project into Eclipse as a Java project. Here are the steps I'm taking:
1. Right-click Package Explorer>> Import >> Git >> Projects from Git >> Next
2. Existing local repository >> Next
3. Select `myapp` project to import >> Next
4. No project found!?!?
As you can see, EGit is looking for some config that isn't there, or perhaps I'm just using it incorrectly.
My questions:
What am I doing wrong, and what can I do to fix this and get the project imported?
How could I improve this process in the future, by using EGit to do the initial clone (bypassing the need to use the raw Git command line)?
Are you sure the project you are importing contains the files eclipse uses for project management?
How does the .gitignore look like? Does it include .metadata/, .project/ for example?
If it does, it means that repo is configured to ignore the configuration files eclipse uses for managing the project, and you should use the wizard to create the project.
I think it is considered good practice to not include any editor specific files in the repos, as these cause a lot of conflicts, and the project shouldn't really depend on the editor like that anyways.

Categories

Resources