Tuesday, 22 December 2009

Recovering lost files in JDeveloper

There is nothing more frustrating than losing a file that stops your application compiling.

Luckily it doesn't happen often these days with source control systems such as Subversion being both freely available, and free to use, but there are still times this occurs so I thought it was worth documenting here how you can reconstruct the missing file using JDeveloper.

Although it's documented in JDeveloper's Tip of the Day, it's surprising how few people remember that Restore from Local History is there when they really need it.

So here is a simple Java app in JDeveloper and I'm going to forcibly lose a file, in this case MyFrame_AboutBoxPanel.java.





Let's delete the file from the disk, to simulate an accidental removal.





And now lets get it back, by invoking Restore from Local History on the owning package.





Select the file that was lost.





Back to where we started with an application that compiles properly again. Hurrah!



2 comments:

  1. doesnt works to files there is no java source code. its stupid but its true. i lost my wsdl...

    ReplyDelete
  2. I do not see the Restore From Local History option in my context menu.

    ReplyDelete

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.