intelliJ IDEA maven打包时提示系统资源不足

在使用IntelliJ IDEA进行Maven项目的install操作时遇到系统资源不足的错误。通过编辑运行配置,增加JVM参数,可以成功解决这个问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

idea中 maven编译waimai_risk项目代码,提示系统资源不足,错误信息如下:

[INFO] Changes detected - recompiling the module!
 
[INFO] Compiling 424 source files to /Users/liulong/workspace/waimai_risk/target/classes
 
系统资源不足。
 
有关详细信息, 请参阅以下堆栈跟踪。
 
java.lang.OutOfMemoryError: Java heap space
 
    at com.sun.tools.javac.util.SharedNameTable.fromChars(SharedNameTable.java:99)
 
    at com.sun.tools.javac.util.Name$Table.fromString(Name.java:204)
 
    at com.sun.tools.javac.util.Names.fromString(Names.java:288)
 
    at com.sun.tools.javac.jvm.ClassReader.includeClassFile(ClassReader.java:2377)
 
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2528)
 
    at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2446)
 
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2143)
 
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:421)
 
    at com.sun.tools.javac.jvm.ClassReader.completeOwners(ClassReader.java:2155)
 
    at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2134)
 
    at com.sun.tools.javac.code.Symbol.complete(Symbol.java:421)
 
    at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:821)
 
    at com.sun.tools.javac.code.Symbol$ClassSymbol.members(Symbol.java:769)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.findAccessMethod(ClassReader.java:1531)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompound(ClassReader.java:1521)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.deproxyCompoundList(ClassReader.java:1510)
 
    at com.sun.tools.javac.jvm.ClassReader$AnnotationCompleter.enterAnnotation(ClassReader.java:1700)
 
    at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:109)
 
    at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:101)
 
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:510)
 
    at com.sun.tools.javac.comp.Enter.main(Enter.java:469)
 
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:929)
 
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
 
    at com.sun.tools.javac.main.Main.compile(Main.java:439)
 
    at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:132)
 
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
 
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
 
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:825)
 
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
 
[INFO] -------------------------------------------------------------
 
[ERROR] COMPILATION ERROR :
 
[INFO] -------------------------------------------------------------
 
[ERROR] An unknown compilation problem occurred
 
[INFO] 1 error
 
[INFO] -------------------------------------------------------------
 
[INFO] ------------------------------------------------------------------------
 
[INFO] BUILD FAILURE
 
[INFO] ------------------------------------------------------------------------
 
[INFO] Total time: 03:40 min
 
[INFO] Finished at: 2017-12-06T11:45:45+08:00
 
[INFO] Final Memory: 77M/121M
 
[INFO] ------------------------------------------------------------------------
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project waimai_risk: 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
 
➜  waimai_risk git:(master)


具体操作如下:waimai_risk-Run Configurations-waimai_risk[install]-右键-选择 edit run confguration,如下

添加jvm参数

重新编译,成功。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值