Netbeans made project disapear? How to recover? - java

I was working on a project, when netbeans freezed and closed abnormaly. When i reopend the project was missing, when i checked the netbeans workspace the folder was missing too.
Does netbeans keep a back-up for his projects? Is there any way to recover ?

Yes of course, hoping the freeze has not break the save system.
For file only it's easy :
Right-click on your project/package
Choose Local History -> Revert Deleted
Now if you have drop all the project you can do this (I've tried it has worked for me)
Create a new project with the same name.
Do the trick for files (2 first points)
If this trick doesn't work I fear you have no more Local History and will never get back your files...

Related

Java files disappeared in Eclipse after exporting

I was working on a project in Eclipse that has several classes and one Interface. I decided to export it as a jar so that I can run it on another machine.
This went just fine. However, when I went back to Eclipse, it suddenly removed all of my file one by one as soon as I tried to edit one of them. Now there is only one file left and it's not even my main. I had everything in the default workspace directory and now only that one file remains.
Can I undo it?
Something similar just happened to me a while ago, Eclipse has the option to recover files no matter if you have a version control or not...
make right click in the project and make a "Restore from local history"
a new window with all accidentally removed files will appear and you can undo the mess :)

Netbeans stuck at startup

I was working with a big project on Netbeans.
I attached some source code on third party library and all went smooth.
Today I have the following popup message (I already had seen before obviously):
The file [...] cannot be safely opened with encoding windows-1252. Do you want to continue opening it?
The two buttons, yes and no, are not responsive. If I close the popup with the red cross it does nothing after a 1 sec loading.
Is there a way to "clean" the open file in the netbeans workspace to avoid this error?
SO Windows 8.1, Netbeans 8.0.2
Thanks.
One general solution to this kind of problem can be to clear the netbeans cache.
Quit NetBeans and find the cache folder - mine is at C:\Users\OldCurmudgeon\AppData\Local\NetBeans\Cache. Delete the whole folder - this can take a while as there can be a lot of files in there.
Netbeans will create a new one on next start.
Note that this will slow down netbeans for a while but it won't be long before it is back up to speed again.
Quit NetBeans.
go to the last Project folder then remove the project from the folder.
Open NetBeans.
I had a similar situation which started happening after I added a new project yesterday. I deleted the cache as someone recommended, but was still having the same issue. The solution was to rename the new project so it wouldn't be found. Everything worked splendidly after that.

Eclipse not launching? How do I save my projects?

I have been using eclipse to learn how to program Java and one day when I tried to use Eclipse it would not open. I get the purple window with a loading bar but when that gets about half way it crashes but does not give me any report as to why it crashed. How could I fix Eclipse or how could I save my projects so that I can reinstall Eclipse?
Your projects are already saved in your hard disk. You just need to reinstall, and when you open again to give the specific path to your projects.
Your projects (Eclipse workspace folder) are saved on your hard-drive . It has nothing to do with your Eclipse crash. If the folder is located inside Eclipse folder, just copy it to some other location. If it is already outside, you are safe.
If you re-install Eclipse, just use this copied workspace as your Eclipse workspace, it should just work fine.
Note: It would be easy to fix existing Eclipse, given you provide exact error message.
be cool , you can get your projects without any problem
1) go to eclipse.org ("https://eclipse.org/downloads/") and download eclipse and re-install then it will bind with your existing workspace in eclipse then you can open your projects through eclipse
2)eclipse default workspace is" C:\Users\yourname\workspace " manualy go to this link in here replace "yourname" with your PC name and get your projects

Cannot convert project... Premature end of file error in Intellij IDE

I am using Intellij IDEA as an IDE for running Java programs. Dues to power fluctuation computer got restarted. Now when I launch the IDE after reboot i am getting the error Cannot convert project: /home/aniket/IdeaProjects/JavaDemoCodes/.idea/workspace.xml: Error on line -1: Premature end of file.
Has anyone encountered this situation before? What can I do to view my project back again?
I also had this after a power failure, I simply deleted the workspace.xml file from the projects .idea folder, restarted IntelliJ and it seemed to be OK apart from loosing which files were open.
Cheers,
Nick
I had this exact error when my laptop bluescreened. I solved it by:
Exit IntelliJ IDEA
Rename .idea folder
Start IntelliJ IDEA
Create new project from existing sources
Exit IntelliJ IDEA
Copy all files from old .idea folder to newly created one.
Restart IntelliJ IDEA
Finally solved the problem. Hers is the solution. First of all I had two Intellij IDEA projects open in two separate windows.
One was the project which had corresponding subversion repository. This was a file-based format project. Files that define a project are .iws, .ipr and .iml. .iws is the one corresponding to the workspace configuration. I just reverted back this file with svn revert project.iws and I could launch my project again.
But the problem in second project JavaDemoCodes still persisted as it was custom project I created and it looks by default we get a directory-based format project instead of file-based format project. This has all its configurations in /home/aniket/.IdeaIC12 directory. As many of you suggested i searched for workspace.xml here but could not find it. I tried find . -name *.xml but i still could not find it(Also as the error suggests there is no file /home/aniket/IdeaProjects/JavaDemoCodes/.idea/workspace.xml ).Finally I did import project from my first project(the one with svn repo) it detected my JavaDemoCodes project as Intellij IDEA project and let me open it in new window.
Not sure if this is the perfect answer but it solved my problem and yes as someone suggested I deleted .iws file from my 1st svn repo based project and tried to restart but was of no help. New .iws file was created but it still gave me the same error.
I have experienced this same problem. It happens to me when I have IntelliJ open and for whatever reason (usually problems with having multiple VPN connections open), my computer freezes and I have to do a forced re-boot.
My solution is to use Windows 7 restore. I'll go to the folder it is complaining about, right click on it, and do a restore. If I'm lucky, I have a restore point only a few days old.
For me, rebuilding my configuration on several projects from scratch is too time consuming. Using a restore point from a few days or even a week makes more sense.
Good luck.
I solved it just by creating a new project, then starting it and then reopening the old project..

Eclipse does not refresh project files in package explorer view

Today I see a strange behaviour of Eclipse 3.5.2 for the first time in 3 months.
First, when I run a main function, it runs a previously compiled version. Let's say I press Ctrl+F11 in the window with an open java class and existing main function. Usually it rebuilds the class and runs a new version. Today even if there was a compile mistake, it would run fine. So I guess it does not recompile the class.
Next, more strangely, if I intentionally make a mistake in the code and Eclipse underlines those lines in red, still the project Explorer does not mark them as containing errors. They remain of grey color if there were not any errors.
First I did not know how to solve this problem. I tried to reopen the project, restart Eclipse and finally reboot the OS. After the tenth attempt, after rebooting, Eclipse said that all project's files are "OUT OF SYNC with the file system". When I pressed "Refresh" - F5 on a project's header name in Project Explorer it finally marked all the files with errors as containing errors and running the main function gave the desired result.
An hour of my work passed and this happened again , with the other project. All the same. No marking of files as red, running no matter what old version of class with no compile errors.
And since Eclipse does not tell that files are out of sync, simply pressing F5 on a project cannot help.
What can you suggest?
When you select a project in the Project Explorer view and press F5, Eclipse should traverse the entire directory tree for the project checking that all files and directories all in sync. It does for me ...
The only thing I can think of that would cause this not to work is if you have file system timestamp anomalies. For example, if a file in the file system is updated but the file's last-modified shows that it was updated in the past. This kind of thing can happen if your machine's system clock is moved backwards or forwards at an inconvenient time. If you think this might have happened, try closing all projects, restarting Eclipse and doing another F5 refresh.
(I used to run into Eclipse synchronization issues a lot, but I put that down to a combination of flakey plugins and doing builds from the command line. Either F5 or Project>Clean usually works for me.)
It is also worth checking that you haven't turned off "Build automatically"; see https://stackoverflow.com/a/2818290/139985. This is not a "refresh" problem, but it would be easy to confuse it with one.
Is Build automatically on? (Menu > Project > Build automatically)
It happened to me because there was a cyclic dependency between two projects. Each project had the other on its build path.
Solution: Reimport the project
It happened to me when checking out a new file from svn in explorer. Eclipse could not find the new file for some reason.
I tried refreshing the project(F5) and Project > Clean and build the project(Project > Build All) none of these worked for me.
So I deleted the project from the Project Explorer view(Not from hard disk). Make sure you unselect "Delete project contents on disk(cannot be undone)" checkbox and save any unsaved changes before you do this.
Now reimport the project using File > Import option. That should work in most cases.
If you use gradle, or something similar, instead of reimporting a project you can just regenerate the project files (gradle eclipse for example), and then you can refresh the project. Less cumbersome than deleting and reimporting.

Categories