最近使用eclipse的时候,当选择完workspace之后,eclipse开始加载启动,在这个阶段经常出现闪退出的情况。
看到日志文件提示一下内容:
org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4441) at org.eclipse.swt.SWT.error(SWT.java:4356) at org.eclipse.swt.SWT.error(SWT.java:4327) at org.eclipse.swt.widgets.Display.error(Display.java:1258) at org.eclipse.swt.widgets.Display.checkDevice(Display.java:764) at org.eclipse.swt.widgets.Display.addListener(Display.java:626) at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:177) at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:185) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:136) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
从网上找了一个方法:启动时给eclipse加一个 -clean,什么意思?
最简单的办法就是在安装目录下找到eclipse.exe,创建快捷方式,右键快捷方式,在目标路径下添加 “ -clean”;
如下图
最后通过快捷方式即可成功运行eclipse!
这个问题出现过很多次,每次都让我重新建workspace,今天小编怒了,动手找了下方法,方便了自己,也分享给大家!
时间: 2024-12-23 18:25:54