Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problems with SVN/Git projects(Many tools are not available when working with SVN or Git projects)
Problems with SVN/Git projects [message #1537534] Tue, 30 December 2014 22:17 Go to next message
Ce Sch is currently offline Ce SchFriend
Messages: 5
Registered: December 2014
Junior Member
Eclipse 4.4, Windows 8, installed on D:

When working on projects, that I have checked out from Git or SVN, there are a lot of helps/ tools missing in the editor.
In fact, Eclipse will only write keywords in bold, that' s it.
There is no Syntax highlighting, a reduced menu when right-clicking on a method/ class or in "Navigate"- tab (eg. no way to open the Call Hierarchy), not even warnings, errors or notes on the left hand side (like the light bulb, when you forget a semicolon).

Those problems do not occur, when I am working on a local project.
(Though, I have to set the path to the current workspace, to get all these things, is this right???)

I have tried following things:
-git workspace iniside and outside of my default workspace
(also changed path inside Eclipse Wink )
-change preferences for each workspace (window -> preferences)
-delete project and clone it again

Any ideas?
Re: Problems with SVN/Git projects [message #1538456 is a reply to message #1537534] Wed, 31 December 2014 10:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
This sounds more like a problem with how the project is configured. If
this is a Java project, likely the folder containing the sources is not
configured as a Java source folder. It's hard to say from what you've
described here. Are the .project and .class files committed to the
source code repository?

On 31/12/2014 5:24 AM, Ce Sch wrote:
> Eclipse 4.4, Windows 8, installed on D:
>
> When working on projects, that I have checked out from Git or SVN,
> there are a lot of helps/ tools missing in the editor.
> In fact, Eclipse will only write keywords in bold, that' s it.
> There is no Syntax highlighting, a reduced menu when right-clicking on
> a method/ class or in "Navigate"- tab (eg. no way to open the Call
> Hierarchy), not even warnings, errors or notes on the left hand side
> (like the light bulb, when you forget a semicolon).
>
> Those problems do not occur, when I am working on a local project.
> (Though, I have to set the path to the current workspace, to get all
> these things, is this right???)
>
> I have tried following things:
> -git workspace iniside and outside of my default workspace
> (also changed path inside Eclipse ;) )
> -change preferences for each workspace (window -> preferences)
> -delete project and clone it again
>
> Any ideas?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problems with SVN/Git projects [message #1538716 is a reply to message #1538456] Wed, 31 December 2014 14:18 Go to previous messageGo to next message
Ce Sch is currently offline Ce SchFriend
Messages: 5
Registered: December 2014
Junior Member
Ed Merks wrote on Wed, 31 December 2014 10:48
This sounds more like a problem with how the project is configured. If
this is a Java project, likely the folder containing the sources is not
configured as a Java source folder. It's hard to say from what you've
described here. Are the .project and .class files committed to the
source code repository?



Thank you so far Smile
This seems to be the problem. Idea
Only .java files are committed. I thought, Eclipse would create a local project with my default settings, when it does not find any configs...
Of course it can't now, that this is a java project... Rolling Eyes

Is it possible to add the .classpath and .project files, without committing them to the repository? There is no need for those files for anyone else, working on this.
The structure on my computer is like this:

/git_workspace
/git_workspace/project (here are all .java files and currently the compiled .class files, too)
/git_workspace/project/.git (repository configurations)
Re: Problems with SVN/Git projects [message #1538747 is a reply to message #1538716] Wed, 31 December 2014 14:42 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Eclipse's project config files (.project, .classpath, .settings, and sometimes more) are designed and intended to be checked in to source control. If no other developers use Eclipse, those files are hidden and quietly ignored by other tools. But in order to avoid the situation you're in, the only option is to check them in; otherwise you have to reconstruct them every time you check out the project.
Re: Problems with SVN/Git projects [message #1544152 is a reply to message #1538747] Sat, 03 January 2015 16:23 Go to previous messageGo to next message
Ce Sch is currently offline Ce SchFriend
Messages: 5
Registered: December 2014
Junior Member
I now have the repository inside of the /src folder from a manually created java project.
This way, the config files are not influenced by any push or pull requests.
I can use all of Eclipse's java tools and even could set .classpath, so I don't have .java and .class files in one folder any more. Smile
Re: Problems with SVN/Git projects [message #1544363 is a reply to message #1544152] Sat, 03 January 2015 19:11 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 01/03/2015 09:23 AM, Ce Sch wrote:
> I now have the repository inside of the /src folder from a manually
> created java project.
> This way, the config files are not influenced by any push or pull requests.
> I can use all of Eclipse's java tools and even could set .classpath, so
> I don't have .java and .class files in one folder any more. :)

Here's the thing...

You want to save .project, .classpath and .settings in Git, so you
should find a subdirectory, .git, directly under your project:

project
+-- .git
+-- .project
+-- .classpath
+-- .settings
+-- src
+-- test
`-- (etc.)

What might make this problematic though is if you're sharing this
project (repository) with a) a colleague or b) yourself on another
computer--if .classpath begins to have machine-dependent paths in it. In
other words, if you tell Eclipse (via Build Path) to consume JARs
outside of your project, then the paths will be put into .classpath, but
will be wrong on your other (or your colleague's) computer.

If you use Maven, none of this will be a problem since classpath will
have much less in it.

I don't want to unload all of this on you if you're new to Eclipse, but
if you have trouble at some point, remember this and come back to ask.
Re: Problems with SVN/Git projects [message #1544431 is a reply to message #1544363] Sat, 03 January 2015 20:08 Go to previous messageGo to next message
Ce Sch is currently offline Ce SchFriend
Messages: 5
Registered: December 2014
Junior Member
Quote:

You want to save .project, .classpath and .settings in Git, so you
should find a subdirectory, .git, directly under your project:
[...]
What might make this problematic though is if you're sharing this
project (repository) with a) a colleague or b) yourself on another
computer--if .classpath begins to have machine-dependent paths in it.


But this is not the case. I think it did not become clear through my last response, but I do NOT share .classpath, .project and .settings.
I see your point in different paths on different machines, but there are really no conflicts.

For more clearity, here is the current structure of my project:

project
+--.settings
+--bin
+--.classpath
+--.project
+--src
---+--package
------+--.git
------+--*.java

So the repository is included into my /src folder as one package (because the whole project is just one package) and it does not touch anything above /package in the hierarchy. I already tried to push and pull commits and it worked just fine.

Though, I will have a look at Maven and probably use it for future projects, to simplify the whole process Wink .
Re: Problems with SVN/Git projects [message #1545146 is a reply to message #1544431] Sun, 04 January 2015 05:45 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 01/03/2015 01:08 PM, Ce Sch wrote:
> Quote:
>> You want to save .project, .classpath and .settings in Git, so you
>> should find a subdirectory, .git, directly under your project:
>> [...]
>> What might make this problematic though is if you're sharing this
>> project (repository) with a) a colleague or b) yourself on another
>> computer--if .classpath begins to have machine-dependent paths in it.
>
>
> But this is not the case. I think it did not become clear through my
> last response, but I do NOT share .classpath, .project and .settings.
> I see your point in different paths on different machines, but there are
> really no conflicts.
>
> For more clearity, here is the current structure of my project:
>
> project
> +--.settings
> +--bin
> +--.classpath
> +--.project
> +--src
> ---+--package
> ------+--.git
> ------+--*.java
>
> So the repository is included into my /src folder as one package
> (because the whole project is just one package) and it does not touch
> anything above /package in the hierarchy. I already tried to push and
> pull commits and it worked just fine.
>
> Though, I will have a look at Maven and probably use it for future
> projects, to simplify the whole process ;) .

"It's not the case." Exactly. But it should be the case. It's what Eric
and I are telling you.

For one thing, your project cannot be cloned in git because the
resulting clone isn't an Eclipse project, it's just a pile of source code.

This is not what you want. The layout I showed you is what you want.

Hope this helps.
Re: Problems with SVN/Git projects [message #1547555 is a reply to message #1545146] Mon, 05 January 2015 13:57 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Russell Bateman wrote on Sun, 04 January 2015 05:45
"It's not the case." Exactly. But it should be the case. It's what Eric
and I are telling you.

For one thing, your project cannot be cloned in git because the
resulting clone isn't an Eclipse project, it's just a pile of source code.

This is not what you want. The layout I showed you is what you want.

Hope this helps.


Exactly. Please re-read my earlier response; you should include in git the Eclipse project configuration files. Trust our years (decades, actually) of experience working with Eclipse projects on small and large teams.

[Updated on: Mon, 05 January 2015 13:57]

Report message to a moderator

Re: Problems with SVN/Git projects [message #1551321 is a reply to message #1547555] Wed, 07 January 2015 14:59 Go to previous messageGo to next message
Ce Sch is currently offline Ce SchFriend
Messages: 5
Registered: December 2014
Junior Member
Then I need some explanation here.
I trust you and your experience, of course, but I don't see too many disadvantages in not including the project (in this case).
The only thing I understand is that I would have to create a project on every computer, I'm working on.
This wouldn't be too bad, costs me 2mins.
If the structure would be more complex, I wouldn't try this, but 15 java files and no structure at all don't require a whole project.

What do I miss? Where are the problems, not including the project?
(The current project is already finished, so it's just interesting to know)
Re: Problems with SVN/Git projects [message #1551385 is a reply to message #1551321] Wed, 07 January 2015 15:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33218
Registered: July 2009
Senior Member
Comments below.

On 07/01/2015 3:59 PM, Ce Sch wrote:
> Then I need some explanation here.
> I trust you and your experience, of course, but I don't see too many
> disadvantages in not including the project (in this case).
> The only thing I understand is that I would have to create a project
> on every computer, I'm working on.
> This wouldn't be too bad, costs me 2mins.
It's not just that, you have to set up the classpath correctly as well,
and make sure the projects have the right natures, and so on.
> If the structure would be more complex, I wouldn't try this, but 15
> java files and no structure at all don't require a whole project.
I'm not sure the aversion to just doing what everyone normally does...
>
> What do I miss?
Doesn't the fact you're asking questions suggest you're missing something?
> Where are the problems, not including the project?
The fact that you have to create it again each and every time.
> (The current project is already finished, so it's just interesting to
> know)
You can see how Eclipse developers themselves manage such things:

http://git.eclipse.org/c/emf/org.eclipse.emf.git/tree/plugins/org.eclipse.emf.ecore

I.e., all files/folders are generally included, except files that are
generated by builders, e.g., .class files in a Java project's bin
folder. That includes the .project, .classpath (for Java projects), and
the entire .settings folder's contents (for any project specific
settings, e.g., Java compiler preferences).


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Integrate Web Tools Into Customized Eclipse
Next Topic:communication PLCs
Goto Forum:
  


Current Time: Wed Sep 25 22:40:41 GMT 2024

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

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

Back to the top