Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » [RESOLVED] Help Setting Up Eclipse with Egit
[RESOLVED] Help Setting Up Eclipse with Egit [message #994261] Wed, 26 December 2012 21:47 Go to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 59
Registered: January 2012
Member
After numerous iterations and trying many of the tutorials around I cannot get Eclipse with Egit to work the way I need. I have a Git central repository (on Linux) that contains a Java application. I want to develop that on Windows with Eclipse under version control. I still do not understand all the various repositories the tutorials tell me to create but no matter what I do I cannot develop my code on Windows. The main problem is that I cannot run the code for debugging purposes. I either do not get a Run as Application menu selection or I get class path errors. My last attempt was to create a local repository on Windows then clone that to an Eclipse project. Can someone point me to or create for me a cookbook method of using the central repository to create a project on Windows that both allows me to run the application and add and commit changes? TIA.

[Updated on: Thu, 03 January 2013 13:52]

Report message to a moderator

Re: Help Setting Up Eclipse with Egit [message #994269 is a reply to message #994261] Wed, 26 December 2012 22:13 Go to previous messageGo to next message
Philippe is currently offline PhilippeFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Dennis,

Did you import your project into your workspace (File / Import / Git) ? Or,
you just cloned your remote repository ?

In all cases, from the Git perpective, and after cloning your repositoy,
the popup menu allows you to import your projects.

Regards,
--
Philippe
Re: Help Setting Up Eclipse with Egit [message #994275 is a reply to message #994269] Wed, 26 December 2012 22:39 Go to previous messageGo to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 59
Registered: January 2012
Member
Thanks for the reply. I tried so many things, I can't really say for sure. IIRC, when I did that none of the wizards worked. The new project wizard resulted in a project that was missing the Run as Application menu item and the existing projects wizard did not find any projects. The general project came the closest, as I could run the application but it would not track changes in git. This is the problem using all the bits and pieces of differnt tutorials to get where I wanted to go. None started with a central repository (remote) and ended with a working Eclipse project (local).
Re: Help Setting Up Eclipse with Egit [message #994538 is a reply to message #994275] Thu, 27 December 2012 16:10 Go to previous messageGo to next message
Philippe is currently offline PhilippeFriend
Messages: 100
Registered: July 2009
Senior Member
Did you read these papers ?
http://www.vogella.com/articles/EGit/article.html
http://wiki.eclipse.org/EGit/User_Guide

Egit and git are similar:
- first, you need to clone your remote repository
- then , you need to import your projects into your Eclipse workspace.
(Note; with egit, you could clone & import your projects in one step)

What kind of projects did you put into your repository ?
- is an Eclipse project ?
- is a Maven project ?
Did you put
- the .settings folder
- the .classpath & .project files
into your remote repository ?
Did you open your local git workspace ?
Did you find all these files and folders?

Regards,
--
Philippe
Re: Help Setting Up Eclipse with Egit [message #994893 is a reply to message #994538] Fri, 28 December 2012 15:25 Go to previous messageGo to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 59
Registered: January 2012
Member
Thanks for the reply. Part of my problem may be conflicting use of the term 'project'. I guess I need to distinguish between an Eclipse project and an IT development project in the normal sense. What is in the remote repository (Linux) is an IT development project that represents a Java application. For the sake of clarity, the repository files have never seen nor know about the Eclipse IDE, or any IDE for that matter. All it consists of is the source files and resources needed to build the application with an ANT build XML. Given that, I want to bring the application under version control using the Eclipse IDE on Windows. Thus there are no Eclipse dependent files in the repository. That is probably the crux of the problem. Although this is a working application, the Eclipse project files would need to be somehow created from existing source.
Re: Help Setting Up Eclipse with Egit [message #994935 is a reply to message #994893] Fri, 28 December 2012 17:18 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
In order to work with a collection of files in Eclipse, they have to be in the form of an Eclipse project, with a .project xml file at the root. You can't import if there are no .project files. The project file provides the Eclipse name of the project as well as its "natures" (what kind of project it is) and builders (how to build it).

For Java projects you'll also need a .classpath file. This is used to describe the locations of source directories, the location of the .class directories, the jar dependencies etc. All this information is already in your Ant file, but you need to add it again in .classpath format.

Once you have a .project file you'll be able to import, and once you have a .classpath file Eclipse will be able to build your project. These two files should be committed and pushed back out to remote repository so that all the other developers on the team can get at them.

You might also want to commit and push settings to ensure that all developers get the same warning checks, formatting conventions etc. This is optional but I highly recommend it.

The details of creating a Java project are outside the scope of the EGIt forum. You should look at the Eclipse Java tutorial for this. If you've never used Eclipse before you really should have a look at the Eclipse tutorials in general, as you won't get much out of Eclipse otherwise. It's a very powerful and flexible system but it's not always obvious how much it can do.


Re: Help Setting Up Eclipse with Egit [message #994970 is a reply to message #994935] Fri, 28 December 2012 18:54 Go to previous messageGo to next message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 59
Registered: January 2012
Member
Thanks for the reply. I have used Eclipse for both PHP and Java but I never paid much attention to its underpinnings (until now I never needed to worry about it). I will take a look again at the Java tutorial but I don't recall anything about creating a .classpath and .project file from an ANT XML (about which I am still just learning).
Re: Help Setting Up Eclipse with Egit [message #994971 is a reply to message #994893] Fri, 28 December 2012 18:53 Go to previous messageGo to next message
Philippe is currently offline PhilippeFriend
Messages: 100
Registered: July 2009
Senior Member
There is an method to create project using ant build.xml in eclipse
File->New->Project->Java->Java project from existing ant Buildfile

So, after cloning your remote/shared repository, you could create the
eclipse project from your local git wxorkspace...

The git 'clone' command copies the entire history of your remote/shared
repository; so, you have it locally and it gives you a workspace of the main
branch. This new local workspace is dedicated to git. Therefore, you need to
create your new Eclipse project in this one (i.e. not in your Eclipse
workspace) if you want to share it...

Regards,
--
Philippe
Re: Help Setting Up Eclipse with Egit [message #995003 is a reply to message #994970] Fri, 28 December 2012 21:11 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
The Eclipse Java Development Tools forum is a very good place to learn more about Java development in Eclipse in general, and to ask specific questions about project configuration details.

http://www.eclipse.org/forums/index.php/f/13/

Re: Help Setting Up Eclipse with Egit [message #997053 is a reply to message #995003] Thu, 03 January 2013 13:51 Go to previous message
Dennis Putnam is currently offline Dennis PutnamFriend
Messages: 59
Registered: January 2012
Member
Building the project with the ANT file worked. Thanks.
Previous Topic:Is it possible to reutilize git repository of tortoisegit within Egit
Next Topic:[RESOLVED] Cannot ignore files/directories
Goto Forum:
  


Current Time: Wed Apr 24 22:09:06 GMT 2024

Powered by FUDForum. Page generated in 0.03368 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top