Bug 3651 - classpath lost when creating a Java project with existing .classpath file (1GDKFWO)
Summary: classpath lost when creating a Java project with existing .classpath file (1G...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P2 minor (vote)
Target Milestone: ---   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:58 EDT by Jim des Rivieres CLA
Modified: 2002-04-01 09:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim des Rivieres CLA 2001-10-10 22:58:37 EDT
I have a directory containing a Java project created on an earlier
occasion (in a different workspace). I want to create a new workspace
and re-create that project and use the existing directory. I can't
seem to do this without losing the class information.

Steps to reproduce:

1. Launch eclipse; create a Java project named "Hello Project" with
source files from /Hello Project/src; create /Hello Project/src/HelloWorld.java
(i.e., in the default package); build; exit eclipse.

2. Launch eclipse for a new workspace (I did this using a separate
install of eclipse).

3. Create a new Java project specifying the location of the existing
"Hello Project" project directory inside the old workspace.

Observe: Although there are local files existing on disk at the project
location, they are not accessed immediately. In particular, the classpath
in the dialog comes up empty. If I proceed, the existing .classpath file
is overwritten and the previously-set classpath is lost.

Expectation: When a project is being created in the workbench, there is
always the possibility that the files for the project already exist on disk.
If they do exist, they should be used; if they do not, they should be created.

NOTES:

PM (5/14/2001 11:24:42 AM)
	I think the problem comes from the fact you use the UI wizard which does enforce a classpath initialization.
	This takes precedence over an eventual .classpath file existency (which is only read when opening the Java project), in fact it
	will be rewritten before the Java model can read it. Unclear though if existing APIs allow to solve this one, but this sounds like
	a problem which could affect WSA as well.

	Moving to Java UI.
	
EG (5/28/01 4:38:46 PM)
	The Wizard could check whether a .classpath exists before initializing a new one.
	This might require additional API to refresh the project's build path from the .classpath file. 

MA (20.08.2001 17:46:23)
	I think, the New Java Project wizard should be allowed to assume that the project is not existing.

	I guess I would have to set the Java nature first, no have access to the existing .classpath file.
	This, however, I can not do before the user pressed finished (cancel is always possible).

	The feature sounds more like a 'Add existing project' where you can specify the location of an existing project, and
	mount it in your workspace. I think this could be supported by the desktop in general (not only for Java project).
	What is needed is the information of the '.vcm_meta' file.
	
	Why isn't '.classpath' part of '.vcm_meta'?
	We should have one project description file, containing all project specific settings.
Comment 1 Martin Aeschlimann CLA 2001-10-16 11:12:37 EDT
moved to 'active'
Comment 2 DJ Houghton CLA 2001-10-24 07:15:35 EDT
PRODUCT VERSION:

eclipse sdk build 105 (jdk)

Comment 3 Erich Gamma CLA 2001-11-11 15:38:58 EST
I agree with Martin. It is fair play when the NewJavaProjectCreationWizard 
assumes that the project doesn't exist.
Comment 4 Erich Gamma CLA 2002-04-01 08:07:56 EST
we have to revisit given the .project file support it has to be possible to 
point to an existing folder with an existing .project and .classpath file.

The assumption that the project does not exist is too limiting.
The capability based wizards create the project before pressing finish so 
setting the nature before pressing finish should be OK.
Comment 5 Martin Aeschlimann CLA 2002-04-01 09:25:54 EST
fixed > 20020328 with the new capability support.
When a project is created that points to a location with existing .classpath 
file, the classpath is taken form this file.