Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Copying a project in same workspace(Trying to copy-paste an Android project to the same workspace)
Copying a project in same workspace [message #653492] Wed, 09 February 2011 23:12 Go to next message
Frode Nilsen is currently offline Frode Nilsen
Messages: 2
Registered: February 2011
Junior Member
Hi I'm relatively green on Eclipse, but I just wasted an hour on something I'd expect to be trivial, so I venture here before I waste anymore hours.

I want to make a copy of an Android project I'm working on so that I can work on the copy in parallell with the old. I did a copy-paste in the file system of the project folder and edited the copy of the .project file so that the project names differ. Then I used the File > Import to add the copied project to the existing workspace.

This failed. Now, none of the projects would compile because the compiler somehow tried to add files from Android.jar twice. This is a conclusion I draw based on the error message I got and what this post says about it. To fix the problem, I had to delete the copy of the project and the reference to the project deep down in the .metadata folder. It took a lot of Googling.

Now... How do I do it the proper way? How do I copy-paste a project without duplicating external references or whatever I did? How can this even happen, doesn't Eclipse treat two projects as two separate entites? How can references in one project affect the other?

Thanks for any input.

[Updated on: Wed, 09 February 2011 23:14]

Report message to a moderator

Re: Copying a project in same workspace [message #653519 is a reply to message #653492] Thu, 10 February 2011 04:59 Go to previous messageGo to next message
Deepak Azad is currently offline Deepak Azad
Messages: 545
Registered: July 2009
Senior Member
On 2/10/2011 4:42 AM, Frode Nilsen wrote:
> Hi I'm relatively green on Eclipse, but I just wasted an hour on
> something I'd expect to be trivial, so I venture here before I waste
> anymore hours.
>
> I want to make a copy of an Android project I'm working on so that I can
> work on the copy in parallell with the old. I did a copy-paste in the
> file system of the project folder and edited the copy of the .project
> file so that the project names differ. Then I used the File > Import to
> add the copied project to the existing workspace.
Did you try copying the project using the package explorer ? It will
allow you to rename the project before it is copied.

> This failed. Now, none of the projects would compile because the
> compiler somehow tried to add files from Android.jar twice. This is a
> conclusion I draw based on the error message I got and what
> http://stackoverflow.com/questions/839435/android-core-libra ry-error/4951589#4951589
> says about it.
I am not sure about the Android specific stuff, but in general you can
add/remove libraries via the Java Build path dialog (right the project
and select Build path from the context menu)

> To fix the problem, I had to delete the copy of the project and the
> reference to the project deep down in the .metadata folder. It took a
> lot of Googling.
>
> Now... How do I do it the proper way? How do I copy-paste a project
> without duplicating external references or whatever I did? How can this
> even happen, doesn't Eclipse treat two projects as two separate entites?
> How references in one project affect the other?
>
> Thanks for any input.
Re: Copying a project in same workspace [message #653622 is a reply to message #653519] Thu, 10 February 2011 13:07 Go to previous message
Frode Nilsen is currently offline Frode Nilsen
Messages: 2
Registered: February 2011
Junior Member
Deepak Azad wrote on Wed, 09 February 2011 23:59

I am not sure about the Android specific stuff, but in general you can
add/remove libraries via the Java Build path dialog (right the project
and select Build path from the context menu)


Yes I'm aware of the build path stuff, and I checked that the .JAR file was only referenced once per project. The reason I post here and not on an Android forum is that it sounded like a general Eclipse problem (or me not understanding Eclipse properly).

I know I could probably circumvent the problem by creating a separate Workspace for each project, but that doesn't sound like the correct solution. It shouldn't be a problem with two Android projects in one workspace, should there?

How would you go about copying a project?
1. Create a new, blank project and then copy-pasting the java files into this?
2. Copy both the project and the java files like I did?

I haven't tried option 1 yet. I'll try that when I get back from work. Even if 1 works, I'd still like an explaination as to why option 2 didn't.
Previous Topic:Changing the access rules for the JDK
Next Topic:Eclipse Classic on Ubuntu
Goto Forum:
  


Current Time: Fri Oct 31 18:39:44 GMT 2014

Powered by FUDForum. Page generated in 0.02322 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software