52

Whenever I start up Eclipse Juno, it gives me an error saying:

An error had occured. Please see the log file:

C:\Program Files\eclipse\configuration\1362989254411.log.

Some websites say to uninstall jdk and install it back again. I did that, but it didn't work. I think it was because on their website, the error is happening IN the workspace. Mine is on the program files folder, which is in the computer.

It happened after updating it. Should I downgrade. If so, how? If I can't downgrade, what should I do?

Cœur
  • 37,241
  • 25
  • 195
  • 267

29 Answers29

131

Try deleting following file from workspace.

YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap

Or try launching it from console.

C:\path\to\eclipse\eclipse -clean
Jeevan Patil
  • 6,029
  • 3
  • 33
  • 50
  • 6
    tried -clean, didn't work for me, then I deleted *.snap from my plugins folder and it fixed it! thanks!!! – Jared Nov 12 '13 at 04:58
  • 4
    I am facing the same issue. I don't see any *.snap files in .plugins folder. Please help – Arun Badole May 05 '14 at 07:26
  • 1
    I followed the first option problem is solved but my projects removed from eclipse. All i had to do was re-import my projects. – Ozan Atmar Jul 12 '14 at 07:44
  • 1
    In option 1 YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/.snap (.snap) file not found for delete – Pranita Patil Jul 18 '14 at 09:19
  • 1
    Removing .snap in the first folder wasn't enough. I had to drill down into all the subfolders of YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/ and remove all .snap files. Then it started normally, I didn't have to do anything else. – mwarren Sep 19 '14 at 14:25
  • 2
    In my case the problem was the user did not have the proper permissions in the eclipse installation folder. Changing the permissions fixed it for me. – Decko Apr 20 '15 at 19:23
  • 1
    This happened to me with Eclipse Version: Mars Release (4.5.0) on Windows 8 after I got the Windows blue screen of death with a CRITICAL STRUCTURE CORRUPTION (Ntfs.sys). Deleting the snap files worked! Thx! – arun Jul 02 '15 at 20:15
  • 3
    deleting .snap didn't work but running the command eclipse -clean works very well – Vítor Nóbrega Oct 13 '15 at 08:13
  • 1
    Removing the file C:\pathto\WorkSpace\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi actually worked for me. – Praveen L Oct 08 '18 at 11:23
  • deleting the .snap did not work for me.!!! deleting the .snap file made the project disappear from my workspace. (i had backup of it, hence was able to get it back. PLEASE try with backup.) – Barani r Oct 26 '18 at 11:39
  • 3
    Many years after this answer, and the file I had to delete (rename) was called `131.snap` instead of just `.snap`, but it still worked... thanks :-) – Amos M. Carpenter Jun 26 '19 at 03:21
47

Solved :

  1. Quit eclipse
  2. GO to your workspace and delete .metadata folder
  3. Now open eclipse with same Workspace path ( You will see as a new workspace )
  4. Now right click import > General > Existing Projects into Workspace > next > Select root directory -> browse to your current workspace and press OK.
  5. Now you will all see your all projects and then hit OK again.
  6. Voila, same projects with same workspace no migration or reference problem.

After trying everything else, this solves my issue.

ravz
  • 968
  • 10
  • 21
  • 2
    I didn't have any .snap files, but this solution worked...! \m/ – mkuse Sep 21 '14 at 05:50
  • Last step, Restart Eclipse , Thanks – Bhavik Mehta Jan 28 '15 at 17:18
  • 2
    **Deleting the `.metadata` also deletes a lot of stuff you want to keep** (preferences, local history, unshared run configurations and much more). If `-clean` and a new workspace (`-data ...`) do not work, deleting the `.metadata` folder won't work either. – howlger Aug 19 '19 at 13:22
13

Delete the .metadata folder from workspace and start the eclipse and now again import all project in same workspace, this worked for me.

DjP
  • 4,537
  • 2
  • 25
  • 34
  • `rm -rf .metadata` worked for me. The files were hidden so I did a `ls -al` in the terminal. – lft93ryt Jan 29 '17 at 12:37
  • **That deletes also a lot of stuff you want to keep** (preferences, local history, unshared run configurations and much more). If `-clean` and a new workspace (`-data`) do not work, deleting the `.metadata` folder won't work either. – howlger Aug 19 '19 at 13:17
  • 1
    i deleted .metadata folder from workspace and start eclipse it works ,then i imported my existing project.........thanks for your answer :) – Integraty_dev Dec 30 '20 at 04:58
9

In my mac machine, I checked whether I installed two java versions or not. I got this error. Because i installed two java at a time.

User -> Library -> Java -> JavaVirtualMachines -> version 1.8.0 and version 11.0.1 has been installed.

I removed version 11.0.1. Now its working fine.

Stephen
  • 9,899
  • 16
  • 90
  • 137
7

I deleted the entire .metadata folder, and it worked for me.

Kerim Tim.
  • 1,159
  • 12
  • 13
4

The best way is to delete all the *.snap files from /.metadata/.plugins/

Makky
  • 17,117
  • 17
  • 63
  • 86
4

Here's what I did to solve this:

  • I removed workspace/.metadata
  • run eclipse as an administrator.
clintgh
  • 2,039
  • 3
  • 28
  • 44
  • **Removing `workspace/.metadata` also deletes a lot of stuff you want to keep** (preferences, local history, unshared run configurations and much more). If `-clean` and a new workspace (`-data`) do not work, deleting the `.metadata` folder won't work either. – howlger Aug 19 '19 at 13:20
4

In my case my JAVA_HOME was pointed to jdk9 after pointing JAVA_HOME to jdk8 resolved my issue. Hope it helps someone.

Moshiour
  • 633
  • 7
  • 20
3

i found the solution. i have installed 2 versions of jre sdk 1.3 and jre7 so i uninstall the older version sdk1.3 then it works.

Codonist
  • 31
  • 4
3
C:\path\to\eclipse\eclipse -clean

Then change the working project directory to something different. It should work after that.

MontrealDevOne
  • 1,034
  • 3
  • 17
  • 30
1

This instruction works 100% for me:

  1. Rename the Eclipse workspace name
  2. Start Eclipse (it will start successfully with empty workspace)
  3. Exit it and change workspace name to previous state(if ask to replace some files, press no)
  4. Start Eclipse again and Re import projects in current workspace

Enjoy!

Amir Hossein Ghasemi
  • 20,623
  • 10
  • 57
  • 53
1

Sounds simple but just delete/uninstall eclipse and install it again.

Jason Saruulo
  • 1,837
  • 4
  • 21
  • 21
1

I was getting the same error while opening the eclipse. to solve that I checked the log file inside the metadata folder. where I found that there is version mismatch of Java. so I have changed the VM inside my eclipse ini file.

-vm /opt/jdk1.8.0_191/jre/bin

Hope this will also help to solve your problem.

Vpn_talent
  • 1,290
  • 12
  • 21
1

None of the current answers worked for me. On CentOS, I had to delete the .eclipse folder from home directory. Then eclipse launched just fine!

Patrick Thorpe
  • 140
  • 4
  • 16
1

For me it was down to a locking/permissions bug on

(path to Eclipse IDE)\configuration\org.eclipse.osgi.manager.fileTableLock

See here

Spring Tool Suite 4 (64 bit for Windows Server 2016)

Version: 4.2.2.RELEASE Build Id: 201905232009

based on Eclipse

Version: 2.2.500.v20190307-0500 Build id: I20190307-0500

wouldn't launch and a pop up dialog appeared saying:

launch error has occurred see log file null

(This became apparent from the latest text log file in the folder (path to Eclipse IDE)\configuration)

!ENTRY org.eclipse.osgi 4 0 
2019-06-19 18:41:10.408
!MESSAGE Error reading configuration: C:\opt\sts-4.2.2.RELEASE\configuration\org.eclipse.osgi\.manager\.fileTableLock (Access is denied)
!STACK 0
java.io.FileNotFoundException: C:\opt\sts-4.2.2.RELEASE\configuration\org.eclipse.osgi\.manager\.fileTableLock (Access is denied)
...

I had to go and tweak the permissions via File Explorer (Full access).

It appeared as if the IDE was doing nothing for a while.

The splash screen for Spring Tool Suite (based on Eclipse) eventually disappeared and the IDE started up again.

Now everything is back working correctly again.

JGFMK
  • 8,425
  • 4
  • 58
  • 92
  • I had the same issue due to running eclipse via the command line as root (sudo ~/bin/eclipse/eclipse). Running again without using sudo logged out the file causing the issue. – Corey May 06 '21 at 13:56
0

I got the same error when I was using Texas Instrument's Code Composer Studio which is built on eclipse. It happened when I changed my Workspace folder to be inside the Google Drive folder. Deleting files from YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.core.resources/ did not work for me.

The following worked for me:

  1. Take backup of original Workspace folder
  2. Delete the original Workspace (from the Google Drive folder)
  3. Start Eclipse (works fine now)
  4. Restore the Workspace backup to a non Google Drive folder

However deleting and restoring the Workspace folder is not advisable since it can have other complications. But I was desperate.

nitred
  • 5,309
  • 3
  • 25
  • 29
0

I had 2 version of JDK installed - JDK 7 and JDK 8. Initially it worked even when both the versions were there and was able to use Git and Gradle and up the Spring Boot Application.

Then after system restart/sleep, workspace prompt did not come up.

Uninstalled JDK 7 and it prompts for workspace,now.

user104309
  • 690
  • 9
  • 20
0

I have got the same error after removing eclipse and installing it again.

Deleting the .metadata directory and running eclipse -clean does not work for me, but the following works for me:

sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86_64/

if you have a 32 bits based system do:

sudo cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86/
N. S.
  • 159
  • 7
0

In my case I didn't want to remove eclipse because in corporate world we can't control everything. Also deleting some files from workspace .matadata could not help. So below hack that I found with trial and error worked for me perfectly :

Go to this path: C:\....\eclipse-Luna\configuration\org.eclipse.core.runtime\

now delete .manager completely.

Start eclipse again and woilaa.. it will run normally.

[In my case, I use eclipse luna. I once abruptly closed the PC when eclipse was open. Then eclipse was not able to start on the next system restart. So keep in mind to close eclipse properly. :) ]

R Dhaval
  • 536
  • 1
  • 9
  • 21
0

My OS architecture is 64-bit so downloaded Eclipse Oxygen 64-bit version and got this error. Tried various solutions posted here but didn't help. Then downloaded Eclipse Oxygen 32-bit version and it works well.

Justinas Jakavonis
  • 8,220
  • 10
  • 69
  • 114
0

For me the problem was that I installed Java sdk 1.9 before installing eclipse. deleting it and installing Java sdk 1.8 instead fixed it. Also, if you are using mac, try

export JAVA_HOME=$(/usr/libexec/java_home)

and then

echo $JAVA_HOME

your should get something like

/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
SubMachine
  • 487
  • 3
  • 11
0

For STS on MacOS, i followed the following steps:

  1. Go to the STS directory from terminal:

    cd /Users/karan.verma/Documents/sts-bundle/STS.app/Contents/MacOS

  2. Start STS

    ./STS

STS started, but all my imported projects were removed.

KayV
  • 12,987
  • 11
  • 98
  • 148
0

The reason may be that you are trying to use old version of Eclipse for new version of Java. I've downloaded the latest Eclipse (which is Oxygen) and it worked for me.

president
  • 503
  • 1
  • 3
  • 18
0

It worked for me when I went to WorkSpace\.metadata\.plugins\org.eclipse.e4.workbench and then remove the *.xmi files.

Praveen L
  • 937
  • 6
  • 13
0

Deleting metadata folder might not work in this case. Or eclipse -clean command. Or reinstall eclipse might not solve this.

Instead try deleting other java versions you might have in your machine.

Check what you have right now using this:

/usr/libexec/java_home -V

Delete other java versions which you don't want, following below command:

sudo rm -rf /System/Library/Java/JavaVirtualMachines/java-version.jdk

This should resolve your issue.

ASM
  • 709
  • 2
  • 8
  • 27
0

The issue is due to the availability of more than one eclipse versions. I tried removing both installations and started with a clean install and it worked. Also, make sure after the install point to a new workspace.

Amith V V
  • 99
  • 1
  • 2
0

In my case, error was due to Java 14 , which is not an LTS, downgraded it to java 8 and it worked.

Saurabh Shukla
  • 458
  • 6
  • 8
0

It happened to me after I rename the file folder. I Try to delete my workspace or .metadata or .manager folder, and not work. Then I download the program again and I choose the complete download. It is 337.511 KB and in zip File. But I place it in Flashdisk. I open the zipfile then I run eclipse.exe. It work. Then I import all my work file. It work back again show in Project Explorer. I close eclipse. Then I click eclipse icon in desktop ( I didn't delete the program). Now It work fine.

Ester Rose
  • 51
  • 1
  • 4
-1

If nothing works, then try uninstalling and then reinstalling Eclipse. This is how i just fixed this problem after trying everything suggested on this forum.

User9211
  • 194
  • 1
  • 2
  • 17