我做內搭ELF文件的應用程序(*和*的.o。),並給出方法名稱列表中,但如果有人重命名的任何文件到*某或*的.o然後它會顯示:如何捕獲java.lang.NoClassDefFoundError?
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
at org.eclipse.cdt.utils.AR.<init>(AR.java:237)
at com.lge.windowELF.ElfBinaryArchive.<init>(ElfBinaryArchive.java:24)
at com.lge.windowELF.ELFParserLibraryFile.createBinaryArchive(ELFParserLibraryFile.java:230)
at com.lge.windowELF.ELFParserLibraryFile.<init>(ELFParserLibraryFile.java:46)
at com.lge.windowELF.ELFWrapper.<init>(ELFWrapper.java:36)
at com.lge.windowELF.ELF_UIIntegrated.actionPerformed(ELF_UIIntegrated.java:510)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
在這種情況下,我想給出一些警告信息。這個異常不被try/catch捕獲。
尋找應該包含'IWorkspaceRunnable'類或接口的JAR文件。它是否存在於你的類路徑中? –
可能重複的[何時趕上java.lang.Error?](http://stackoverflow.com/questions/352780/when-to-catch-java-lang-error) – adatapost
它可以通過抓住這個特定的錯誤或「Throwable」。但可能是你應該更優雅地處理你的代碼中丟失的文件條件... – aishwarya