Eclipse一直用的好好的,突然这两天每次启动都会出现如下的错误:An internal error occurred during: "Updating indexes".org/eclipse/core/runtime/internal/adaptor/BasicLocation,刚开始没有在意,以为是机器的内存不够导致,但后来发现不是怎么回事,刚开机,打开Eclipse也报这个错误。找到Eclipse的日志文件,workspace/.metadata/.log,查询"Updating indexes"关键字,找到如下的异常信息:
!SESSION 2017-12-26 09:55:24.278 -----------------------------------------------
eclipse.buildId=4.6.3.M20170301-0400
java.version=1.8.0_151
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
!ENTRY org.eclipse.emf.ecore 2 0 2017-12-26 09:55:42.461
!MESSAGE Both ‘org.eclipse.m2e.model.edit‘ and ‘org.maven.ide.eclipse.maven_model_edit‘ register a package for ‘http://maven.apache.org/POM/4.0.0‘
!ENTRY org.eclipse.emf.ecore 2 0 2017-12-26 09:55:42.485
!MESSAGE Both ‘org.eclipse.m2e.model.edit‘ and ‘org.maven.ide.eclipse.maven_model_edit‘ register an extension parser for ‘pom‘
!ENTRY org.eclipse.core.jobs 4 2 2017-12-26 09:56:41.130
!MESSAGE An internal error occurred during: "Updating indexes".
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/core/runtime/internal/adaptor/BasicLocation
at org.maven.ide.eclipse.internal.index.EquinoxLocker.lock(EquinoxLocker.java:26)
at org.maven.ide.eclipse.internal.index.NexusIndexManager.updateRemoteIndex(NexusIndexManager.java:1067)
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:55)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.internal.adaptor.BasicLocation cannot be found by org.maven.ide.eclipse_0.12.1.20110112-1712
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
可以看到是跟maven相关,在从异常信息分析,应该在更新索引时出错了OutOfMemoryError
解决办法:
Window——>Preferences——>Maven
去掉Download repository index updates on startup前面的勾
重新启动Eclipse,问题解决