Royi Namir
Royi Namir

Reputation: 148744

Clone project with eclipse?

I'm learning JAVA with Eclipse (ADT , Latest version - For Android development).
Each lesson we enhance the same project. (I don't like this approach)
So - I want to create different project for each lesson so :
Each lesson I'm cloning the main folder - and then I import it as an existing project.
( I thought that cloning + renaming the folder - would be fine)

But :

Eclipse says that the project already exists. (make sense)

Question

If I have a folder that contains a project ( LeadoMat) :

enter image description here

, And I'm creating folder LeadoMat_Ver2 ( cloned files)

— How/What should I do in order for eclipse to accept it as a new project named : LeadoMat_Ver2 ?

Upvotes: 29

Views: 39339

Answers (3)

Gim
Gim

Reputation: 89

Right Click and choose Copy (to copy project that you want to clone) Right Click on blank area on Package Explorer tab choose Paste Input project name wait and you have a new one

Upvotes: 0

i_turo
i_turo

Reputation: 2729

The simplest approach would probably be to do the copying right in eclipse:

Right Click your Project -> Copy
Right Click in the Project Explorer -> Paste

or

CTRL + C & CTRL + V

Eclipse will then automatically prompt you to enter a new name for the clone. Then you'll have a full copy of your project with the new name.


The reason why eclipse thinks that it is the same project, is because you also clone the .project-files which contain the name of the project used in eclipse.

Upvotes: 66

Robby Cornelissen
Robby Cornelissen

Reputation: 97331

The project folder contains a file called .project. In your cloned project, open that file with any text editor and look for the project name:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>LeadoMat</name>
    <!-- more stuff here -->
</projectDescription>

Change the content of the name element to LeadoMat_Ver2. You should now be able to import the project into Eclipse.

Upvotes: 25

Related Questions