这个问题在这里已经有答案了:
maven编译:执行javac失败(5个答案)
上个月关门了。
当我运行时,我得到以下堆栈跟踪 mvn clean install package
```
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:615)
at com.sun.tools.javac.comp.Attr.visitBinary(Attr.java:3033)
at com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1785)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:566)
下面是maven的stdout/stderr的一个小节
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] An unknown compilation problem occurred
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.903 s
[INFO] Finished at: 2020-12-09T03:55:20+08:00
[INFO] Final Memory: 26M/596M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project test: Compilation failure
[ERROR] An unknown compilation problem occurred
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
有人能教/帮助我如何解决这个问题吗?
1条答案
按热度按时间hwamh0ep1#
您可以通过修改调用期间发送给java的标志来更改堆栈大小。
https://www.baeldung.com/jvm-configure-stack-sizes#custom
这将为您提供2MB的堆栈大小(而不是默认的1mb)。
您可以添加
-Xss2m
(或任何你需要的-实验将被要求)到你的MAVEN_OPTS
环境: