2018年11月22日 星期四

eclipse 啟動失敗 出現java.lang.ArrayIndexOutOfBoundsException

用了eclipse 這麼久,第一次遇到這個問題 記錄一下

在前次關閉eclipse都很正常的情況下,在啟動eclipse 竟然出現一個警訊 說無法啟用,要我去看LOG 檔 ,在eclipse\configuration\ 下可以看到log file 出現了以下的錯誤訊息:

.....
!ENTRY org.eclipse.osgi 4 0 2018-11-22 09:47:13.010
!MESSAGE Application error
!STACK 1
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.util.Arrays.copyOfRange(Unknown Source)
at java.util.Arrays.copyOfRange(Unknown Source)
at org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.lambda$7(ChooseWorkspaceDialog.java:380)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.createUniqueWorkspaceNameMap(ChooseWorkspaceDialog.java:382)
at org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.createRecentWorkspacesComposite(ChooseWorkspaceDialog.java:325)
at org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.createDialogArea(ChooseWorkspaceDialog.java:176)
at org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:158)
at org.eclipse.jface.window.Window.create(Window.java:426)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1095)
at org.eclipse.jface.window.Window.open(Window.java:783)
at org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.prompt(ChooseWorkspaceDialog.java:114)
at org.eclipse.ui.internal.ide.application.IDEApplication.promptForWorkspace(IDEApplication.java:342)
at org.eclipse.ui.internal.ide.application.IDEApplication.checkInstanceLocation(IDEApplication.java:261)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:128)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)



經上網查了一下,排除方式很容易,只要將eclipse/configuration/.settings中的所有文件刪除就可以正常開啟了,但刪除後,一些設定包含先前記下的workspace都會被重設,不過這比不能啟動來說,還算OK啦。

而有其它篇文章有寫到  刪除 eclipse/configuration/.settings/org.eclipse.ui.ide.prefs kot. 就可以,因我已先整個目錄都刪除了,沒機會實測,等下次再碰到時再確認看看。

參考資料:

沒有留言:

張貼留言