Eclipse “An error has occurred. See the log file .metadata/.log.”

I am currently using Eclipse Indigo Service Release 1 and out of a sudden received a strange error message when trying to open my workspace, or in fact any workspace:

An error has occurred. See the log file [WORKSPACE-DIR]/.metadata/.log.

Inspecting the log file, it seems that this behaviour was caused by an OutOfMemoryError error in a subpackage of org.eclipse.core which is somewhat strange, as I have plenty of memory available for the VM. A Google search for the error, suggested to invoke Eclipse via the command line with the -clean option:

eclipse/dir> eclipse -clean

Eclipse successfully started again and subsequently also without the -clean option. However, an interesting message was writen into the log file:

!MESSAGE The -clean (osgi.clean) option was not successful. Unable to clean the storage area: C:\eclipse-dir\eclipse\configuration\org.eclipse.osgi.

Nevertheless, Eclipse is working fine again and I am not experiencing any problems while programming, so I guess that inspite of the log message, the -clean option works.

51 thoughts on “Eclipse “An error has occurred. See the log file .metadata/.log.”

  1. Hi everett,

    That’s not an eclipse-specific command line. It is the regular command prompt (cmd.exe under Windows for me). Navigate into the folder of your eclipse executable and run the command. This should work regardless of whether the UI is able to start or not.


  2. my eclipse is giving me the same error that yours has, how do I use the command line in eclipse when it wont even launch fully?

  3. Right Java 9 has been released in the meantime :)

    There are some compatibility issues with Java 9. The engineers at Oracle decided to encapsulate the internal APIs (*) using the new module system. This means that applications which directly use this API will have a hard time. With a project so huge as Eclipse, there’s a good chance that some part is using the now encapsulated API and, therefore, has problems to run with Java 9.

  4. OMG THANKS A LOT BRO ! was looking for it like 1 week . I had the jdk 9 , intalled the 8th and woked perfectly.

  5. 1st just uninstall Java JDK ..

    2nd reinstall jdk 8 ..

    3rd run Eclipse as administrator ..

    worked fine with me after while of search

  6. Hi Jörg,

    I ran into this problem recently and found this thread, a lot of the people were saying they couldn’t solve the problem. So I left a solution that worked for me, just to help anyone who runs into this issue in future to save their time.


  7. Hi sam,

    Sure, I guess a new workspace is always an option. The problem of that is normally that you will also get the default preference configuration of a new workspace and that’s what I wanted to avoid here (if I recall it correctly, it’s been five years after all).


  8. Try using a new workspace. To force the workspace window prompt you need to change the settings in \configuration\.settings\org.eclipse.ui.ide.prefs and set SHOW_WORKSPACE_SELECTION_DIALOG to true.

  9. Why would you store your projects in a folder such as .”…/metadata/.plugins/org.eclipse.core.resources”? Unless you performed the deletion via command line, your operating system should also have a recycle bin.

  10. Delete: /YOUR PATH TO WORKSPACE/.metadata/.plugins/org.eclipse.core.resources



    I also lost a semesters worth of projects..

  11. At least on my case, my problem happened because I changed my old Eclipse for Eclipse Luna, but I was still referencing the old workspace. I recommend to rename the older one and create a new one with the original name. Then Eclipse will start with a clean workspace. Thats why it works on first time and not on second.

  12. same problem .. It worked when i deleted this…workspace path/.metadata/.plugins/org.eclipse.core.resources

  13. same problem .. It worked when i deleted this…workspace path/.metadata/.plugins/org.eclipse.core.resources

  14. i tried the -clean method
    and the Delete: /YOUR PATH TO WORKSPACE/.metadata/.plugins/org.eclipse.core.resources

    but neither worked
    what should i do?

  15. Hi,
    nice to hear it helped! According to Wikipedia, XMind is based on Eclipse RCP, which explains why the clean command did the trick. Hopefully, your comment will help future XMind users!
    Regards, Jörg

  16. Hey Jörg, I found your info very fruitful for another programm which seems to be very dependend on eclipse. I am talking about XMind Pro 3.3 for Linux. After the upgrade to the Pro version I suddenly could not start XMind anymore and got the same error message in the box. The log file messages may have been different, but no matter what I tried the problem stayed, until I found you tip.

    So for all XMind user who face this problem, just type
    “[path to xmind dir/XMind -clean]” in the terminal.

    Thanks a lot!
    Cheers, Bauer

  17. Hehe, true ;-) But I think that this error is a quite generic one that reoccurs over distributions and operation systems and is also caused by a variety of reasons. I don’t really know where it came from in my case and I don’t really know whether the fix I proposed is the right one. Using an outdated version of Eclipse or Java may save you from some errors, but then again you also can’t use all those pretty new features :-)

  18. Strangely enough, I was having the “error has occured” message on Eclipse Juno, JDK 1.7. The log has a lot of traces from MercurialEclipse, so perhaps that’s part of the problem. Ironically, I was thinking it was nice to have the latest Eclipse and JDK easily installed on Windows, but my Ubuntu setup doesn’t have these problems, using the (slightly outdated) version in the repositories.

  19. Hi,
    as I said in the post, I was using Eclipse Indigo. I no longer have the installation available (Juno is here), and I was using jdk1.7, but I don’t know which revision exactly was the most recent at the time.

    I would suggest you to use the most recent stable versions of Eclipse (Juno, 4.2) and Java (7u5). Java 1.4.2 is already a decade old. If you use a jdk which is that outdated, you should have very strong and specific reasons for doing so.

  20. Hi, I had tried the above method but seems not working in my case.
    Until I use this and it works. First you need to know what version of Eclipse you are trying to run and what version of JRE you currently using.
    In my case, i used 3.2.2 eclipse and jr37 (this will not work!). you should use use j2sdk1.4.2_16 it works fine.

  21. Hi,

    by “the same error”, do you mean the clean command does not help and you still get “An error has occurred. See the log file [WORKSPACE-DIR]/.metadata/.log.“ or do you mean the message printed in the log file?

Comments are closed.