Home » Newcomers » Newcomers » Why do I keep losing my workplaces?(they keep going away and I have to start over)
|
Re: Why do I keep losing my workplaces? [message #1702238 is a reply to message #1702236] |
Mon, 20 July 2015 22:53 |
|
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] |
Tue, 21 July 2015 00:19 |
|
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.
|
|
|
Re: Why do I keep losing my workplaces? [message #1702247 is a reply to message #1702243] |
Tue, 21 July 2015 02:16 |
Norman Noobie Messages: 7 Registered: April 2015 |
Junior Member |
|
|
I'll need to sleep on that as it seems 100% sdrawkcab from my mental model of how things work, but right now what you just said just seems confusing.
How do you have a project tree that doesn't contain any source files? What's the point of having a project tree if the source files are under Grandma's mattress?
(next day) Thanks for the link to vogella.de/tutorials, that's explaining a lot of things I was fuzzy on.
[Updated on: Tue, 21 July 2015 13:37] Report message to a moderator
|
|
|
Re: Why do I keep losing my workplaces? [message #1702311 is a reply to message #1702247] |
Tue, 21 July 2015 13:35 |
|
On 07/20/2015 08:16 PM, Norman Noobie wrote:
> I'll need to sleep on that as it seems 100% sdrawkcab from my mental
> model of how things work, but right now what you just said just seems
> confusing.
>
> How do you have a project tree that doesn't contain any source files?
> What's the point of having a project tree if the source files are under
> Grandma's mattress?
The project "tree" (filesystem) does have source files.
Think of the workspace as a sheet of paper containing a list of projects
and where they live. Some of them, by default, live inside the same
drawer (filesystem) as the workspace. This is how it will probably be
for you as a beginner. If you ever do serious development, those
projects (that is, their source files) will live in a version control
system like Git and will probably not live inside the workspace
subdirectory, but on a path outside it which depends on how your group
sets up projects.
What's confusing is that I gave you the whole story instead of a narrow
one. That was probably a mistake.
Just stop thinking of the workspace as your project, that's all.
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 14:00:41 GMT 2024
Powered by FUDForum. Page generated in 0.08825 seconds
|