Eclipse startup error

2019-02-16 05:20发布

问题:

Today when I started eclipse I got the following error message:

An internal error occurred during: "Updating indexes". Java heap space

When I checked the log, there is this exception:

!ENTRY org.eclipse.core.jobs 4 2 2011-06-14 13:44:26.546
!MESSAGE An internal error occurred during: "Updating indexes".
!STACK 0
java.lang.OutOfMemoryError: Java heap space
at org.sonatype.nexus.index.updater.IndexDataReader.readUTF(IndexDataReader.java:132)
at org.sonatype.nexus.index.updater.IndexDataReader.readField(IndexDataReader.java:122)
at org.sonatype.nexus.index.updater.IndexDataReader.readDocument(IndexDataReader.java:96)
at org.sonatype.nexus.index.updater.IndexDataReader.readIndex(IndexDataReader.java:63)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.unpackIndexData(DefaultIndexUpdater.java:564)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:252)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:74)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:815)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:995)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:159)
at org.maven.ide.eclipse.internal.index.NexusIndexManager.updateRemoteIndex(NexusIndexManager.java:1085)
at org.maven.ide.eclipse.internal.index.NexusIndexManager.updateIndex(NexusIndexManager.java:1025)
at org.maven.ide.eclipse.internal.index.NexusIndexManager$1.run(NexusIndexManager.java:632)
at org.maven.ide.eclipse.internal.index.IndexUpdaterJob.run(IndexUpdaterJob.java:71)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
!SESSION 2011-06-14 13:46:30.734 -----------------------------------------------
eclipse.buildId=M20100909-0800
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

I tried the following with no success:

  • Increase the memory in the .ini file in eclipse:

    -Xms128m
    -Xmx512m
    -XX:MaxPermSize=256m
    
  • Create the environment variable "MAVEN_OPTS:-Xmx256m"

  • Delete the ~/.cache/m2e directoy

Does anyone have another idea?

回答1:

This problem was caused by older versions of the m2e plugin for Eclipse.

Newer versions no longer transfer the remote index automatically, so the first recommended solution is to upgrade to the latest version of m2e. If that is not possible then follow the instructions below.


This problem is caused by the M2Eclipse plugin transferring remote indexes from a Nexus ( or compatible ) repository.

  1. Disconnect from the network;
  2. Start Eclipse.
  3. Uncheck the preference Maven -> Download repository index updates on startup.

You can now reconnect to the network and should restart Eclipse to verify that this has indeed fixed the problem.



回答2:

If you are running into this error recently, it may be due to an issue with Luna (eclipse 4.4.0) and m2e (1.4.1). The solution is to uninstall m2e 1.4.1 and install m2e 1.5.0 under Help-->Install new Software-->All Available Sites. Official eclipse bug report.



回答3:

Are there other m2e cache directories? Some bug reports on this issue propose to delete ~/.m2/repository/.cache/m2e. Generally, for me it seems to be a maven / nexus problem (maybe m2e).



回答4:

Try increasing the memory in the .ini file to:

Xms256m Xmx768m



回答5:

Keep the larger memory already suggested.

Try starting from the command line with a "clean" argument.

eclipse.exe -clean

From the command line you may also specify which workspace to open with the -data argument. Perhaps start with an alternative, small workspace until your IDE is back on its feet.



回答6:

Can you increase the memory and try with -Xmx1024m



回答7:

Try with even more memory :)

-Xms512m
-Xmx1024m
-XX:PermSize=256M
-XX:MaxPermSize=512M