【问题标题】:IntelliJ IDEA: StackOverflowError on Build ProjectIntelliJ IDEA:构建项目上的 StackOverflowError
【发布时间】:2020-10-28 21:20:18
【问题描述】:

我正在使用以下 IntelliJ。

IntelliJ IDEA 2017.2 EAP
Build #IU-172.2953.9, built on June 14, 2017
IntelliJ IDEA EAP User
Expiration date: July 14, 2017
JRE: 1.8.0_152-release-915-b3 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.5

我在构建项目时遇到 java.lang.StackOverflowError

有没有人遇到过同样的情况?

构建消息↓

Information:java: The system is out of resources.
Information:java: Consult the following stack trace for details.
Information:java:   at com.sun.tools.javac.code.Types$13.visitClassType(Types.java:1955)
Information:java:   at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:786)
Information:java:   at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4571)
Information:java:   at com.sun.tools.javac.code.Types.asSuper(Types.java:1952)
Information:java:   at com.sun.tools.javac.code.Types.unboxedType(Types.java:3987)
Information:java:   at com.sun.tools.javac.code.Types.unboxedTypeOrType(Types.java:3998)
Information:java:   at com.sun.tools.javac.comp.DeferredAttr$ArgumentExpressionKind.standaloneKind(DeferredAttr.java:1135)
Information:java:   at com.sun.tools.javac.comp.DeferredAttr$DeferredChecker.visitLiteral(DeferredAttr.java:1296)
Information:java:   at com.sun.tools.javac.tree.JCTree$JCLiteral.accept(JCTree.java:2037)
Information:java:   at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
Information:java:   at com.sun.tools.javac.comp.DeferredAttr$FilterScanner.scan(DeferredAttr.java:913)
Information:java:   at com.sun.tools.javac.comp.DeferredAttr.isDeferred(DeferredAttr.java:1100)
Information:java:   at com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:669)
Information:java:   at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1815)
Information:java:   at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1465)
Information:java:   at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:575)
Information:java:   at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3249)
Information:java:   at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1897)
Information:java:   at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1824)
Information:java: Errors occurred while compiling module 'webapi'
Information:javac 1.8.0_101 was used to compile java sources
Information:2017/06/21 21:22 - Compilation completed with 1 error and 49 warnings in 24s 170ms
Error:java: java.lang.StackOverflowError

【问题讨论】:

  • 检查你的工作区是否有'.meatadata/.log',也许你会在那里找到提示
  • 发布完整的异常堆栈跟踪。
  • @CrazyCoder 这就是我的全部。
  • 尝试添加-Xss4m here
  • @CrazyCoder 谢谢!成功了!

标签: java intellij-idea


【解决方案1】:

-Xss4m 添加到构建过程 VM 选项应该会有所帮助:

【讨论】:

  • 2019 内存量还是够用的 :)
  • 我试过了,但即使我将内存增加到 8192m,它也无法正常工作。事实证明,我错过了在文件 → 设置 → 构建,执行,部署 → 构建工具 → Maven → Runner VM 选项中添加它,如下面的答案之一所述。
【解决方案2】:

如果您在运行/调试配置中遇到问题,您可以在运行->编辑配置->虚拟机参数中进行更改: -Xms512M -Xmx1024M -Xss4M -XX:+CMSClassUnloadingEnabled

【讨论】:

    【解决方案3】:

    我也遇到了同样的问题。我终于按照以下步骤修复了它:

    在 IDEA 中:

    1. 文件→设置→构建、执行、部署→构建工具→Maven→运行器 虚拟机选项:添加-Xss4096k

    2. 文件→设置→构建、执行、部署→编译器 共享构建过程虚拟机选项:添加-Xss4m

    【讨论】:

      猜你喜欢
      • 2018-05-27
      • 2014-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-21
      • 2012-10-31
      • 2019-09-07
      相关资源
      最近更新 更多