I had a folder that I downloaded from GitHub which is a group project for college. I worked on it a bunch and added tons of code and then planned to reupload this big folder straight back up to GitHub (yeah, worst version control in the world I know). We were just incrementing the project folders by 1 each time so I renamed the folder in my Eclipse workspace to Project3. I then tried to reopen this folder in Eclipse and every time I selected it nothing happens. It has me very worried. Luckily most of my code was in a class file which I am still able to access however there are some changes here and there in other files that I made which ideally I would like back. Any idea what I should do to be able to open this project up in Eclipse again? I should also note that I tried renaming it back to the original name.
I'm working on a group project for my software engineering course, and my professor has indicated that I set up the directory structure incorrectly on Github. I'd like to correct the issue now to avoid a grade penalty, but I'm very new to using Git. Basically we have a structure that is as follows on Github.
src
--main
----java
------Source Files
--test
-----java
------Test Files
Various Ivy/Ant build files
.classpath
.gitignore
.git
.project
README.md
I need to create a new directory called CodeComp that will contain the directory structure above except for the README.md, which should be on the same level as the CodeComp directory.
Since our grade is dependent on the commit history, this would need to be preserved. Is there an easy way to do this or are we better off just taking the small deduction on the final project grade?
UPDATE:
In case anyone else has to do this in the future:
Go to the folder holding the project and create the new directory.
Move all files needed into the new directory except .* files. Refresh Eclipse.
Commit and Push the directory changes to the repo regardless of Eclipse errors.
Manually delete the .classpath, .gitignore, and .project files from the repository.
Back-up your .classpath and .gitignore files. Delete your local copy of the repo and re-clone it.
Import the Git project and choose to put the project files in your newly created directory.
Copy the .classpath and .gitignore you backed up into the new project directory. Push the changes.
In theory you should be able to use a standard file browser to move everything but your .git and Readme file into your new sub-folder and then commit that.
The git history will still there but it may see it as two separate files, one that has been deleted and one that is just created. In my experience Git doesn't really like moving files.
In any case, you commit history will still be in the repository, it will just be 2 separate sections from when you moved the files.
But, hey... It may pay to show that move anyway. I know for sure that I was moving files all around when I first learnt about version control. It's all learning.
EDIT: You can test this by committing the change locally and checking the history before you push it upstream to Github.
I am having an issue in Eclipse. If I create a project, then delete it and check the "Delete project contents on disk (cannot be undone)" check box, a project created afterwards with the exact same name and settings will not be created with a MainActivity.java file.
If I create a project then delete it without checking that box, it can be recreated with the MainActivity.java file but will require you to open and save the fragment_main XML file before the project can be deleted again (with or without checking the check box).
What is happening here? Why does it behave in this way?
#Zach H
When deleting a project give you two options(The dialog box will ask your confirmation for deleting from workspace or not)
Simple Delete
Delete from workspace
Under simple delete-
As you delete a project then the project gets deleted in the Package Explorer but is still present in your workspace directory (i.e. the path where your projects are stored) because you didn't select delete from workspace option.
Under Delete from workspace-
When you confirm the option delete from workspace then you project gets deleted from your hard disk as well.
When you simply choose delete then you can create a same project with same activity because the project with same name is not there in the package explorer. Only if the same project already exists then you will get an error asking you to rename your project.
The above said problem happens only when you have not installed the ADT/Eclipse properly(missing some files from the SDK Manager).
My suggestion for you is that you first install all the packages from the tools because a missing support tool could coz such problem as above
When you delete a Eclipse project this is what happens:
If you choose delete on disk - You delete the project and the files from the PC.
If you don't choose delete on disk - You only delete the project from eclipse but the files still there, so if you create a new project with the same name them put automatically.
For this case when you need some files from old projects,
So, the best way is import or export projects.
I hope this help you.
I think Eclipse is trying to make me miserable. A couple of hours ago, my project was working and compiling well. Suddenly that all changed. Eclipse somehow wipes out all changes I have made to my files(activity, manifest etc.) I make sure to save often but when I go to run the project, I get the error that I have a build error. I checked and there was none, so I go to close Eclipse, so I can reopen and see if the errors will go away. Instead what happens is Eclipse wipes clean all my files and I end up with a project on disk with lots of blank code files. I try to run anyway, and I get the error message below.
Failed to read the project description file (.project) for 'com.example.android.nfc.simulator.FakeTagsActivity.FakeTagsActivity'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state.
Anyone have an idea what in the world this is about and how I can rectify this?
I would recommend to wipe out all the eclipse related configuration files(make sure you take the backup if you have manually made some changes in those) and import the project again, by following
File -> Import... -> Existing Project into Workspace
Make sure you take the backup of whole project before doing this.
When Eclipse gets stuck in some obscure status, I usually find useful to recreate the .metadata folder in workspace directory. It is a drastic solution, but it usually works for me. After that you can reimport all your projects.
This happened to me because I had a conflict in my .project file. I opened it up in a text editor and fixed the conflict (in my case, removed from ====... to >>>branch..., as well as <<<HEAD) and then I was able to open the project in eclipse.
I was just encountering this same issue (using Zend Studio 12, which is built on Eclipse). My problem was that I was creating a project from a Remote Server, and I was just downloading everything, which also included the .project file from the old project. It wasn't showing this error until I'd closed the program and tried to open it again (which usually wasn't until the next day).
I seem to have resolved it by making sure not to download the .project when initializing the project.
If the .project file is a text file, so if you have it in version control you might want to copy it over from there.
Before you trying the following make a backup of your current project state.
Assuming you don't have an old copy, you can open it in a text editor and try to see if there is something obvious wrong.
If this fails, copy the source files of your project to a fresh location (without the eclipse configuration files) and import it as a new project into eclipse.
if you still have all of your other source (.java files, AndroidManifest.xml, resources), you might be able to get your project back by simply going to the folder containing the project, removing the .project file that you say is now empty, and then using the new project wizard to recreate the project (and .project file) for you from your existing tree of source.
from the menus, select File -> New... -> Project , and then, in the first dialog, choose Android Project from Existing Code .
if you had done anything special to the .project (reliance on specific .jar files or changes to classpath), you may have to re-do these steps after you re-create your project; but at least it should pick up the code you already have.
If all the files are empty, and you have no working Backup, I can't help. I would recommend to use proper version control in the future.
Use git or mercurial, they have nice UI integrations (see tortoisegit/tortoisehg).
To decouple the build process and library management from eclipse, take a look at maven or gradle, this might help you in future projects.
If you use git, complete the merge e.g. del the head in your androidmanifest.
I also got the Same Issue in Eclipse but the real problem is i removed the actual Source project folder from source location (from which eclipse is trying to take the project) to some other place hence my eclipse is unable to get web.xml file since it is not available. Now i changed my source project folder location to the path where eclipse is trying to search for. Issue Resolved for me.
Just delete the 'servers' folder in your workspace and try again.
I'm looking for SVN plugin, which can export diff files between 2 revisions to runnable jar file.
So I will give it to another man, who just run it on test/production server, and jar automatically will update project with exported diff files.
It's easy to write command tool like I need, but I'm looking for Eclipse plugin.
If I'm reading this right my issue is similar to yours.
Back in Eclipse 3.2 (ish) in the synchronize perspective, you could select locally changed files, then do File > Export and choose JAR, and it would select the files for you. Now it doesn't.
If you want just the text diff, it's easy. Just use the create patch option.
If you want to create a jar containing the changed files - which I find useful for recording the changes for a chunk of work, or saving the alterations to a branch when I want to work on another, then its possible but unnecessarily laboured. (Works with Indigo)
Exporting changes in eclipse Synchronize view:
Select all of them in the synchronize view
Right Click and choose Show In > Project Explorer
In the Project Explorer that appears, all the files should be selected. Some may be collapsed in their parent package. Use the + to make sure they are all visible and selected.
right click in the Project Explorer and choose Export > Java > Jar File, or drag the files into an explorer window if you want them in a flat directory.
What you want is just not possible (at least, not using SVN / text diffs).
SVN/diff work with text files. The result with diff is a excerpt with only the lines changed in a file (in this class a .java source file). These files cannot even be compiled because they are not java code (even if the lines themselves are).
What you may do is use svn log to check which files have changed, retrieve the associated .class files and use them to patch the server. Do not know if there is any tool that makes that automatically, though (and it is complicated as often the .class files are not commited into subversion).