tags:

views:

60

answers:

3

Hi,

A newbie question (I haven't really created new projects in Eclipse yet): I have a machine running Linux with a fresh install of Eclipse 3.5.2. I want to create a new Java project in an existing subversion repository (which already contains some unrelated stuff). So after running Eclipse I get this dialog to specify workspace. What is the best practise here? Should it be in subversion? Then when I created a random one, when I add a project it goes into the workspace. So if my workspace is not in subversion, where and how should I get these projects there?

Background: probably I will work on my own on this project, however I have 2 PC's which I want to be able to use interchangeably.

+1  A: 

What I usually do is put the workspace out of the way in ~/.workspace (invisible directory). Then I create new projects outside of that workspace, in the Subversion checkout directory.

You can create a project outside the workspace as follows:

  • Create a directory in your Subversion repository. Your project will live in this directory.
  • In Eclipse, click File; New; Project.
  • Choose the desired project type; click Next.
  • Instead of "Create new project in workspace" (the default), select "Create project from existing source". The name is misleading: the source does not have to exist, just the directory!
  • Click Browse and select the directory that you just created.

Eclipse will create a .project file and other support files in the directory you specified. Simply add all these files to Subversion, and you're all set.

Thomas
Ah, the fourth bullet point was the thing I was missing here!
Grzenio
One downside of this approach of having the data outside of the workspace is that it makes the workspace non-portable, whereas if you keep your data inside the workspace you can move an entire workspace between machines, start an Eclipse pointing to it, and have all your projects and settings as before.
Fabian Steeg
Hi, I did what you said. During the process I get prompted to add all the files to subversion, I click yes, but then the project doesn't seem to be linked to subversion in any way (I installed subclipse). Any ideas?
Grzenio
No, sorry. I have only very little experience with Subclipse.
Thomas
+1  A: 

Hi,

Your workspace is the folder where eclipse will place all of your projects.

Basically, once you've linked Eclipse with a SVN repository, retrieving a SVN project will send him to the workspace, thus allowing you to work on it. Once you've made the changes, you can right click on your project in the project bar (on the left, by default) and chose ->team/subversion (depending on the eclipse version) -> commit.

If you want to send a project into your subversion, you create a new project inside your workspace. Then, you right click on the project in your project bar and do the same thing.

Pier-Luc Faucher
I would suggest the same: using SVN from within Eclipse - you will have to install SVN support into Eclipse first, e.g. http://www.polarion.com/products/svn/subversive/download.php
Fabian Steeg
A: 

let's say that your workspace dir is /home/grzenio/workspace and your project name is project

first of all, go to to /home/grzenio/workspace, then checkout the source code, so the code will be at /home/grzenio/workspace/project.

Open eclipse, and create a new project from the folder selecting "Create project from existing source". Select /home/grzenio/workspace/project

Voilá!

pakore