Robin Coe
Robin Coe

Reputation: 750

Why does Eclipse Mars not read the project location correctly?

I have a project that has lived in my workspace for some time. It is a git project and I use Egit and cygwin git to manage it. Not sure if that's relevant.

I'm not sure what's messing up eclipse but, in the last day, I have noticed that when I start eclipse, my project is marked as closed. When I looked at the project properties, I saw that eclipse is using the wrong path. Instead of:

C:\cygwin64\home\rcoe\git\projectname

it is now pointing at:

C:\cygwin64\home\rcoe\.gitconfig\projectname

However, my .metadata .location file (which is binary) shows that the location is correct. This file is buried in my workspace, which is located in my Windows home directory.

I tried deleting my project and re-importing it, both as a git project and as a general project, and it opens no problem. I can even close and open eclipse right away and the project stays open. However, give it a few minutes and re-open eclipse and the project now thinks it lives under a non-existent .gitconfig directory. I even tried creating a new workspace and importing my project. Same behaviour.

So, I'm not sure whether this is an Eclipse Mars bug, or Egit, or something else. Has anyone seen this kind of behaviour before?

Edit: I hit new snags trying to share my project using Eclipse 4.4. The Luna git plugin threw errors about the plugin. So I went back to Mars (4.5) and created a new workspace. The .location file looks like this

@±‹#¼ %–磓¾ 2URI//file:/C:/cygwin64/home/rcoe/git/logprocessing              ÀXûó#¼ QóŒ{»wÆ

but when I open Eclipse, the properties of the project looks like:

C:\cygwin64\home\rcoe\.gitconfig\logprocessing

I have no idea what Eclipse is using for its location, if not the .location file.

Upvotes: 1

Views: 834

Answers (2)

Robin Coe
Robin Coe

Reputation: 750

I found what looks to be a solution. I moved the .gitconfig file from my cygwin home, which is where Eclipse was configured to look for it. On starting Eclipse, I was able to import my project without error. And even though Eclipse's previous error messages implied it wanted to write to the project directory beneath a .gitconfig directory (cf. https://bugs.eclipse.org/bugs/show_bug.cgi?id=473782), Eclipse did nothing of the sort.

I am now able to restart Eclipse, run my unit tests, etc., without error. I am also able to interact with my Git repo using Eclipse, even though Eclipse no longer points at my .gitconfig and so does not know my user.name or user.email properties.

Upvotes: 1

VonC
VonC

Reputation: 1325137

On Windows, it would be best to use git for Windows instead of git in Cygwin. It comes with Git 2.4.6 released 5 days ago.

That way, Eclipse doesn't have to manage two different filesystem, and two different HOME (C:\cygwin64\home\rcoe vs. %USERPROFILE%)

Upvotes: 0

Related Questions