Android project, code got deleted during move of project folder - java

So Ive worked on a small android game for the past months and it was located on my desktop. I figured it would be good practice to keep it in my workspace folder instead! So I moved the project folder to the workspace, imported it back into eclipse and boom... all code was gone. The classes code, the manifest.. all that was left was the assets. In the projects folder when opening one of the classes in notepad it is also gone.
Is there a way to recover the lost code or something? I dont understand why the code would dissapear just because I moved the folder?

Eclipse keeps a history of all files worked on in the following directory:
Workspace\.metadata\.plugins\org.eclipse.core.resources\.history
You'll have to search through it to find all your file. They might also not be the latest revision, but it has saved me many times.

you can try with the Eclipse's Local History

Related

Getting Errors After Moving Springboot Application to a Different Directory

I have fully working Springboot application project in my Downloads directory but when i moved this project to a different directory for example : C:/User/Documents folder its still running but giving me visual errors. it shows the classes are not imported even though they are and application is still running fine
https://i.stack.imgur.com/8Bmuy.png
Im sure what's the reason is.
PS: Im using git. as version control for this project not sure if it is because I initialized the git when this project was in Downloads folder.
If someone knows the solution please let me know.
Thank you
My suggestion would be to:
Close IntelliJ
In your file explorer/finder, go to the directory you project is is now
delete the .idea, .mvn and target folders
Open Idea again and just open the project from the folder again
Likely Idea is just confused.

Renamed a project in my Eclipse workspace via the filesystem and now cannot open it.

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.

Eclipse Forcing Me To Name My Project A Specific Name

I was looking at my code today and my project was giving me errors so I ended up deleting the thing (It had some code I was done with). Next I went to create a new project my the same name but when I did it gave me the same project with all the old .java files inside. So I went on to trying to make the name in lowercase and eclipse game me this "error" if you would even call it that???
Stack Overflow said I had to use a link to the image so please don't say "you broke the rules".
Normally whenever one deletes a project in Eclipse it will ask if you want to delete the entire project contents on the disk. Like so:
Deleting Eclipse project
If not, check your projects folder in Eclipse via Finder to make sure that entire folder is deleted.
You can change your workspace location in eclipse or move the old project to other location from your location. Hope this will fix your problem

Issues getting files from my friend to work on my eclipse?

My friend sent me a project from his eclipse workspace for me to take a look at, however when I tried to put the folder in my workspace it did nothing. I opened eclipse and nothing was there. So i tried to make my own project and just put the .java and .class files in their respected folders, but it still didn't work. Is there some special way I have to transfer them? I should also mention he has a windows computer and I have a mac if that makes any difference for file types like that. Thanks for the help!
If you can just take the .java files and paste them into your 'src' folder in a new eclipse project, you should have no issues. Just make sure you refresh your project in eclipse(right-click on project folder and click refresh, or click on it and hit f5).
This is what i normally do.
Suppose your eclipse workspace is D:\EclipseWorkspace and your project name is Project1.
Then i would copy Project1 in eclipse workspace on disk to have D:\EclipseWorkspace\Project1.
Then create a new java project in eclipse and when prompted for name provide name as Project1 (exactly same) and say finish. It will import the project automatically. Everything should be up :)

Eclipse Hell . . . Failed to read the project description file (.project)

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.

Categories

Resources