java IntelliJ IDEA:构建项目上的 StackOverflowError

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44675448/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:17:56  来源:igfitidea点击:

IntelliJ IDEA: StackOverflowError on Build Project

javaintellij-idea

提问by d-_-b

I am using the following IntelliJ.

我正在使用以下 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

I have been getting java.lang.StackOverflowErrorupon building the project.

在构建项目时,我一直收到java.lang.StackOverflowError

Has anyone fallen into the same situation?

Build Message↓

有没有人陷入同样的​​情况?

建造讯息↓

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.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

回答by CrazyCoder

Adding -Xss4mto the build process VM options should help:

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

vm options

虚拟机选项

回答by binary

If you are getting the issue in Run/Debug configuration, you can change the same in Run->Edit Configurations->VM parameters: -Xms512M -Xmx1024M -Xss4M-XX:+CMSClassUnloadingEnabled

如果您在运行/调试配置中遇到问题,您可以在运行->编辑配置->VM 参数中更改相同的内容:-Xms512M -Xmx1024M -Xss4M-XX:+CMSClassUnloadingEnabled

enter image description here

在此处输入图片说明