how to specify source folders in a java project from a SVN checkout

After installing subclipse on a new eclipse (europa) installation, I proceeded to checkout the trunk from the svn repository.  This contains many folders under trunk, each folder being a separate project.   Upon checkout, the trunk (and the rest) were under the workspace folder

Assume that one of the project folders is called project1.. So locally, it is under workspace\trunk\project1

How do I create a Java project that only pertains to project1 files and resources (and will let me commit etc) ?  When I tried to do this and specified this folder, it complained that the project must be directly under the workspace folder (which it is obviously cannot).
Who is Participating?
yaxhConnect With a Mentor Commented:
First you need to open 'SVN Repository Exploring Perspective' using "Select Perspective" dialog window. Now after doing that, add new "Repository Location". You can now browse whole repository and can check out whatever you require from repository. It could be trunk itself of subproject under that trunk.

Following doc of snapshots might help you in this regard:
1. Goto FILE > Project

2. Select java project

3. In the Content box, select "Create project from existing source"

4. Browse to your project folder checked out from SVN.

nsriramAuthor Commented:
"Projects located in the workspace folder must be direct sub folders of the workspace folder" says eclipse when I try to browse to the relevant folder.

Obviously had I just checked out the relevant project into the workspace, this problem doesnt happen as the project1 is directly under workspace folder.  So I imagine this means that one has to check out each project individually instead of checking out a trunk superfolder that has multiple project folders.
nsriramAuthor Commented:
yaxh:  Your suggestion involves checking out a single project to the workspace. Eclipse likes this because that project is directly under workspace. However suppose one (for whatever reason) checked out trunk itself, then the relevant project folders are one level deeper in the workspace (and under svn control).  It appears that Eclipse doesnt like this (as its "idea" of a project in workspace maps on to a folder directly below workspace).  In any case, I am accepting your solution (what I did was just to follow what eclipse liked, check one project out at a time).
nsriram: One more thing you can do here.

1. Create a local project using project wizard.
2. Import source from the sup-projects under the trunk which you have already checked out. The import allows you to get any source from  local file system, or even shared network too.

The problem here (may be it's just me) is when I do any SVN action, it complains about some missing "tmp" directory. So, what i did was I manually (out side of eclipse) copied (after import) actual source from sub-project (overridden the imported one) under trunk to locally created project. Then I went to eclipse and refreshed the project which i have created. Now it lets me do anything which I wanted to.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.