昨晚打开Eclipse软件截图写了一篇博客,就关掉了软件,后来电脑也没有关机就去睡觉了,早晨点击Eclipse发现,人工呼吸也不能救活了。
出现这个弹框:
查看.log日志文件也不是很懂:
!SESSION 2019-03-30 10:23:12.879 ----------------------------------------------- eclipse.buildId=4.9.0.I20180906-0745 java.version=11 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.jpt.dbws.eclipselink.core.gen 4 0 2019-03-30 10:23:14.383 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.core.gen [449] Unresolved requirement: Require-Bundle: org.eclipse.persistence.dbws.builder; bundle-version="[2.3.0,3.0.0)" -> Bundle-SymbolicName: org.eclipse.persistence.dbws.builder; bundle-version="2.7.1.v20171221-bd47e8f" org.eclipse.persistence.dbws.builder [728] Unresolved requirement: Import-Package: javax.xml.bind; resolution:="optional" Unresolved requirement: Import-Package: org.eclipse.persistence.tools.oracleddl.metadata; version="1.0.0"; resolution:="optional" Unresolved requirement: Import-Package: org.eclipse.persistence.tools.oracleddl.metadata.visit; version="1.0.0"; resolution:="optional" Unresolved requirement: Import-Package: org.eclipse.persistence.tools.oracleddl.parser; version="1.0.0"; resolution:="optional" Unresolved requirement: Import-Package: org.eclipse.persistence.tools.oracleddl.util; version="1.0.0"; resolution:="optional" Unresolved requirement: Require-Bundle: org.eclipse.persistence.dbws; bundle-version="2.7.1" -> Bundle-SymbolicName: org.eclipse.persistence.dbws; bundle-version="2.7.1.v20171221-bd47e8f" org.eclipse.persistence.dbws [727] Unresolved requirement: Import-Package: javax.ws.rs; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.ws.rs.core; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.ws.rs.ext; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.xml.bind; resolution:="optional" Unresolved requirement: Import-Package: javax.xml.bind.annotation; resolution:="optional" Unresolved requirement: Import-Package: javax.xml.bind.annotation.adapters; resolution:="optional" Unresolved requirement: Require-Bundle: org.eclipse.persistence.moxy; bundle-version="2.7.1" -> Bundle-SymbolicName: org.eclipse.persistence.moxy; bundle-version="2.7.1.v20171221-bd47e8f" org.eclipse.persistence.moxy [731] Unresolved requirement: Import-Package: com.sun.xml.bind; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.bind.annotation; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.bind.api; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.bind.api.impl; resolution:="optional" Unresolved requirement: Import-Package: com.sun.codemodel; version="[2.2.11,3.0.0)"; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.xsom; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.xsom.impl; resolution:="optional" Unresolved requirement: Import-Package: com.sun.xml.xsom.impl.parser; resolution:="optional" Unresolved requirement: Import-Package: com.sun.tools.xjc; version="[2.2.11,3.0.0)"; resolution:="optional" Unresolved requirement: Import-Package: com.sun.tools.xjc.model; version="[2.2.11,3.0.0)"; resolution:="optional" Unresolved requirement: Import-Package: com.sun.tools.xjc.outline; version="[2.2.11,3.0.0)"; resolution:="optional" Unresolved requirement: Import-Package: javax.json; resolution:="optional" Unresolved requirement: Import-Package: javax.json.stream; resolution:="optional" Unresolved requirement: Import-Package: javax.validation; version="1.1.0"; resolution:="optional" Unresolved requirement: Import-Package: javax.validation.constraints; version="1.1.0"; resolution:="optional" Unresolved requirement: Import-Package: javax.validation.groups; version="1.1.0"; resolution:="optional" Unresolved requirement: Import-Package: javax.validation.metadata; version="1.1.0"; resolution:="optional" Unresolved requirement: Import-Package: javax.ws.rs; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.ws.rs.core; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.ws.rs.ext; version="2.0.1"; resolution:="optional" Unresolved requirement: Import-Package: javax.xml.bind Unresolved requirement: Import-Package: javax.xml.ws.handler; resolution:="optional" -> Export-Package: javax.xml.ws.handler; bundle-symbolic-name="javax.xml.ws"; bundle-version="2.1.0.v200902101523"; version="2.1.0" javax.xml.ws [38] Unresolved requirement: Import-Package: javax.xml.bind Unresolved requirement: Import-Package: javax.xml.ws; resolution:="optional" -> Export-Package: javax.xml.ws; bundle-symbolic-name="javax.xml.ws"; bundle-version="2.1.0.v200902101523"; version="2.1.0" Unresolved requirement: Import-Package: javax.xml.ws.soap; resolution:="optional" -> Export-Package: javax.xml.ws.soap; bundle-symbolic-name="javax.xml.ws"; bundle-version="2.1.0.v200902101523"; version="2.1.0" Unresolved requirement: Require-Bundle: org.eclipse.persistence.moxy; bundle-version="2.7.1" -> Bundle-SymbolicName: org.eclipse.persistence.moxy; bundle-version="2.7.1.v20171221-bd47e8f" at org.eclipse.osgi.container.Module.start(Module.java:447) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1664) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1558) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
由于不清楚Eclipse打不开的原因,所以就查找各种解决方法,发现并不管用
最粗暴有效的解决方法:
1.可以选择重新安装Eclipse,解决100%问题
2.如果还有Eclipse安装文件,可以选择重新建一个文件夹作为Workspaces,然后再重启Eclipse,也能解决问题
但是我不想错过这样一个锻炼自己解决错误的机会,所以上面简单粗暴的方法,我并没有采用
先总结一下失败的方法:
网上查到我尝试的方法
查看log文件,发现有这样的信息: !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. 解决方案: 删除\.metadata\.plugins\org.eclipse.core.resources\*.snap这个文件, 重启Eclipse,会成功。
失败原因:我对应文件夹里面没有这个文件
查看log文件,发现有这样的错误信息: !MESSAGE FrameworkEvent ERROR 解决方案:cmd命令进eclipse,运行命令 eclipse.exe -clean后会自动打开软件,启动成功
失败原因:提示eclipse.exe -clean不是内部命令,Eclipse更没有自动打开
eclipse版本太新会出现这样的问题, 解决方法: 1,打开eclipse安装目录下的eclipse.ini文件; 2,打开的文本文件最后添加一行 --add-modules=ALL-SYSTEM 3,保存重新打开Eclipse。
失败原因:Eclipse依然打不开,并且.ini文件添加的内容在我重新打开Eclipse的时候自动消失了
1.打开eclipse工作空间D:\eclipse\workspace\.metadata\.plugins\org.eclipse.core.resources找到.projects文件 2.打开.projects文件,删除该目录下所有工程里的.markers.snap和.syncinfo.snap文件 3.再次启动eclipse就OK了!
失败原因:.projects文件下所有工程里只找到了.markers文件,删除后Eclipse依然打不开
将configuration\org.eclipse.osgi\.manager路径下的.fileTableLock删除, 重新启动就正常了。
失败原因:这种原因解决成功是因为Eclipse没有正常关闭导致的锁了,很明显我的不是这个原因,再次失败。
当然还有一些是因为jdk版本的问题,我没有动我的jdk所以应该不是这个问题了
好了,说一下我是怎么解决的,经历过上面的种种操作,我把电脑关机,上午关机一直到晚上才打开,点击Eclipse发现可以打开了,我也懵逼中,所以建议大家节省时间,去用简单粗暴的方法