Home » Newcomers » Newcomers » Why do I keep losing my workplaces?(they keep going away and I have to start over)
Why do I keep losing my workplaces? [message #1702236] |
Mon, 20 July 2015 18:21  |
Eclipse User |
|
|
|
Kepler service release 2 running on Win 8.1
Why do the source files in my Workspaces keep disappearing? Here's the scenario. I work in Workspace foo for a while. I then switch to Workspace bar (a completely different project). I then want to work on Foo again, but there are no source files. The source files are present on the disk, but according to Eclipse I've just started a new project. I fix it by checking my files into my VCS, using Eclipse to create a bunch of MT files with the same names, killing Eclipse, then pulling my files back out of my VCS. Restart Eclipse, all is good.
Whiskey Tango Foxtrot?
My directory layout is
...../Workspace
+ Foo
+ .metadata
+ .other eclipse files
+ Src
Foo.java
+Bar
+ .Eclipse dot files
+ Src
Bar.java
BarClass1.java
BarClass2.java
Am I using Eclipse wrong? Should I have 1 workspace and switch projects? I'm an Eclipse n00b.
|
|
|
Re: Why do I keep losing my workplaces? [message #1702238 is a reply to message #1702236] |
Mon, 20 July 2015 18:53   |
Eclipse User |
|
|
|
On 07/20/2015 04:21 PM, Norman Noobie wrote:
> Kepler service release 2 running on Win 8.1
>
> Why do the source files in my Workspaces keep disappearing? Here's the
> scenario. I work in Workspace foo for a while. I then switch to
> Workspace bar (a completely different project). I then want to work on
> Foo again, but there are no source files. The source files are present
> on the disk, but according to Eclipse I've just started a new project.
> I fix it by checking my files into my VCS, using Eclipse to create a
> bunch of MT files with the same names, killing Eclipse, then pulling my
> files back out of my VCS. Restart Eclipse, all is good.
>
> Whiskey Tango Foxtrot?
>
> My directory layout is
>
> ...../Workspace
> + Foo
> + .metadata
> + .other eclipse files
> + Src
> Foo.java
> +Bar
> + .Eclipse dot files
> + Src
> Bar.java
> BarClass1.java
> BarClass2.java
>
> Am I using Eclipse wrong? Should I have 1 workspace and switch
> projects? I'm an Eclipse n00b.
>
It's a little hard to follow, but yes, you appear not to grasp the
difference between workspaces and projects.
Think of workspaces as a convenient collection of possibly related
projects. You can put as many projects into a workspace as you like, but
I tend to have several workspaces containing closely interrelated projects.
Also, if you've imported the same project into different workspaces, you
might be inconvenienced as well--depending on what you had in mind.
Hope this helps.
|
|
| |
Re: Why do I keep losing my workplaces? [message #1702243 is a reply to message #1702241] |
Mon, 20 July 2015 20:19   |
Eclipse User |
|
|
|
On 07/20/2015 05:26 PM, Norman Noobie wrote:
> I admit I'm confused as to the difference between a Workspace and a
> Project. I like to keep my source code under a single directory, for
> Java I'm using Workspace. Is Workspace a magic word in Eclipse (I think
> Eclipse created it first time I ran it)? Would I be better off renaming
> my Workspace directory to something like Java_Code?
>
> Nothing is imported, I don't do enough Java to have common files between
> unrelated projects.
>
> If it helps, whenever I create a new project the source files always end
> up in .../Workspace/New_Project/New_Project/normal eclipse files and
> dirs. That is, the name of the new project is repeated twice. Why?
> Hellifino, and I spent a lot of time once trying to figure it out.
Here's your workspace with a couple of Java projects:
/home/norman/dev/workspace
+-- ProjectA
`-- ProjectB
The Eclipse workspace is equivalent to what's in the Eclipse workbench
(IDE) at any given time when you launch it. The workspace is equal to
the Project, Package and Navigator Views in the Eclipse workbench. You
access ProjectA and ProjectB via the workbench out of the workspace.
The workspace is a filesystem anchor for Eclipse. In the workspace,
there is a subdirectory, .metadata, that corrals all the known
information about the workspace, including settings, the list of
projects in it, etc.
I'm talking about Java projects here.
The project has .project, .classpath and sometimes other files and/or
subdirectories (like .settings) depending on what kind of project it is
IF IN FACT it is an Eclipse project at all. Underneath your project you see:
/home/norman/dev
+-- ProjectA
| +-- src
| `-- test
`-- ProjectB
+-- src
`-- test
The workspace has nothing whatsoever to do with the organization of any
of the projects it contains. It might not even contain the project
filesystems (I never put my project source code inside the workspace
filesystem, for example, though Eclipse makes the workspace the default
place to create a new project.)
The project, on the other hand, is the most important entity. It exists
separately from Eclipse and from the workspace it is in. It doesn't need
Eclipse to build, indeed, it should not need Eclipse to build. If you're
working on real, commercial software, it likely will not be built by
Eclipse except when you're working with it. Otherwise, it will be built
by Jenkins/Hudson, CruiseControl, your favorite build system, Maven,
ant, whatever.
So, the workspace is just where you "pin" a project so Eclipse can work
on it.
I suggest you follow some tutorials that lead you through building
workspaces and projects to some end. I would suggest vogella.de/tutorials.
Be patient, it will sink in.
|
|
| | | | |
Goto Forum:
Current Time: Tue May 20 09:31:56 EDT 2025
Powered by FUDForum. Page generated in 0.12134 seconds
|