`
willvvv
  • 浏览: 334095 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

eclipse java.lang.ArithmeticException zero

阅读更多

昨天Eclipse出问题了,自动生成代码时就报错


跟踪日志发现:

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:477)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2579)
at org.eclipse.ui.internal.progress.ProgressManager$6.run(ProgressManager.java:1203)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1197)
at org.eclipse.jdt.ui.actions.OverrideMethodsAction.run(OverrideMethodsAction.java:242)
at org.eclipse.jdt.ui.actions.OverrideMethodsAction.run(OverrideMethodsAction.java:190)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:278)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.lang.ArithmeticException: / by zero
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.createIndentationString(DefaultCodeFormatter.java:144)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.createIndentString(ASTRewriteFormatter.java:196)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.createIndentString(ASTRewriteAnalyzer.java:278)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ParagraphListRewriter.getSeparatorString(ASTRewriteAnalyzer.java:878)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ParagraphListRewriter.getSeparatorString(ASTRewriteAnalyzer.java:867)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:561)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteParagraphList(ASTRewriteAnalyzer.java:997)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1575)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:467)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:271)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:260)
at org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation.run(AddUnimplementedMethodsOperation.java:224)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4694)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
... 40 more
Root exception:
java.lang.ArithmeticException: / by zero
at org.eclipse.jdt.internal.formatter.DefaultCodeFormatter.createIndentationString(DefaultCodeFormatter.java:144)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteFormatter.createIndentString(ASTRewriteFormatter.java:196)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.createIndentString(ASTRewriteAnalyzer.java:278)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ParagraphListRewriter.getSeparatorString(ASTRewriteAnalyzer.java:878)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ParagraphListRewriter.getSeparatorString(ASTRewriteAnalyzer.java:867)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer$ListRewriter.rewriteList(ASTRewriteAnalyzer.java:561)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.rewriteParagraphList(ASTRewriteAnalyzer.java:997)
at org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.visit(ASTRewriteAnalyzer.java:1575)
at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:467)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2480)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.internalRewriteAST(ASTRewrite.java:271)
at org.eclipse.jdt.core.dom.rewrite.ASTRewrite.rewriteAST(ASTRewrite.java:260)
at org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation.run(AddUnimplementedMethodsOperation.java:224)
at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4694)
at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2579)
at org.eclipse.ui.internal.progress.ProgressManager$6.run(ProgressManager.java:1203)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1197)
at org.eclipse.jdt.ui.actions.OverrideMethodsAction.run(OverrideMethodsAction.java:242)
at org.eclipse.jdt.ui.actions.OverrideMethodsAction.run(OverrideMethodsAction.java:190)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:278)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

 杯具。。。难道要重装。。好多插件啊。。

  • 大小: 11.9 KB
分享到:
评论

相关推荐

    java.lang.ArithmeticException(解决方案).md

    项目中碰到的,记录一下解决方案

    在Java中异常分析

    - **异常路径**:`java.lang.Object -> java.lang.Throwable -> java.lang.Exception -> java.lang.RuntimeException -> java.lang.ArithmeticException` - **解释**:执行算术运算时发生错误时抛出,如除以零。 - *...

    java.lang包

    例如,`ArithmeticException`、`NullPointerException`和`IOException`等都是异常类的实例。异常处理通过使用`try-catch-finally`结构来实现。`try`块包含可能会抛出异常的代码,`catch`块用于捕获并处理这些异常,...

    解析Java中所有错误和异常的父类java.lang.Throwable

    在Java编程语言中,`java.lang.Throwable` 是所有错误(Error)和异常(Exception)的顶级父类,它是异常处理机制的基础。`Throwable` 类提供了封装异常信息的方法和属性,使得开发者能够对程序中出现的问题进行捕获...

    JAVA常见的错误

    java.lang.ArithmeticException 是一种常见的错误,发生在数学运算异常时。例如,在程序中出现了除以零这样的运算时,就会出现该错误。解决方法是检查代码,确保数学运算是正确的。 4. java.lang....

    Easy-Es 搜索引擎框架 v1.1.1.zip

    "Easy-Es 搜索引擎框架 v1.1.1.zip" 是一个包含源代码和相关文档的压缩包,主要用于搜索引擎的开发与应用。这个框架可能是为简化搜索引擎的构建过程而设计,版本号1.1.1表明这是一个经过迭代优化后的稳定版本。...

    java 异常种类总结【转】.docx

    Java 异常种类总结 Java 异常种类总结是指在 Java 编程语言中,各种可能发生的异常类型的总结。这些异常可能会在编程过程中出现,并且可能会...java.lang.ArithmeticException 是一种算术条件异常,例如整数除零等。

    java 除0发生的算术异常(ArithmeticException)

    `ArithmeticException`是Java中`java.lang`包的一部分,它继承自`RuntimeException`。这种异常通常发生在表达式计算过程中遇到错误的情况,比如除以零。当程序执行到这样的代码行时,如果不捕获这个异常,程序会立即...

    java异常详解

    当执行算术运算时遇到非法操作,如除以零,将会抛出`java.lang.ArithmeticException`。这类异常通常发生在涉及数值计算的代码段中,需要开发者仔细检查并处理。 #### 4. `java.lang.ArrayIndexOutOfBoundsException...

    常见JAVA异常总结

    `java.lang.ArithmeticException` 是一个算术运算异常,通常由以下情况引发: - 整数除以零。 - 浮点数除以零。 - 其他违反数学规则的运算。 - **解决方法**: - 对于整数除法,应先检查除数是否为零。 - 使用...

    常见的java异常.pdf

    3. **java.lang.ArithmeticException**: 发生在执行非法数学运算时,例如除以零。在进行数学计算时,应检查可能的除零条件或其他可能导致错误的条件。 4. **java.lang.ArrayIndexOutOfBoundsException**: 这个...

    java异常类型.txt

    6. **`java.lang.ArithmeticException`** - 发生算术运算错误时抛出此异常,例如除以零的情况。 7. **`java.lang.SecurityException`** - 安全相关的异常,当安全管理器检测到一个安全性违规行为时抛出。 8. **`java...

    JAVA常见异常解析,面试用

    3. **java.lang.ArithmeticException**: 表示执行了非法的数学运算,如除以零。在进行数学计算时,需要特别注意除数不能为零,并检查其他可能导致计算异常的情况。 4. **java.lang....

    java常见异常.pdf

    3. **java.lang.ArithmeticException**: 当执行非法的数学运算,如除以零,会抛出此异常。在编写涉及数学运算的代码时,应进行适当的错误检查,例如避免除以零的操作。 4. **java.lang....

    java编程常见问题

    9. **java.lang.ArithmeticException**: 当执行如整数除以零这样的非法算术运算时,会抛出此异常。应该添加适当的错误处理来避免这种情况。 10. **java.lang.ArrayIndexOutOfBoundsException**: 当尝试访问数组的...

    JAVA常见异常解析

    3. **java.lang.ArithmeticException**: 当执行非法的数学运算时,如除以零,Java会抛出此异常。在编写涉及数学运算的代码时,应添加适当的检查以防止除以零或其他可能导致ArithmeticException的操作。 4. **java...

Global site tag (gtag.js) - Google Analytics