简体   繁体   English

当我运行 mvn install 时出现错误

[英]when i run mvn install ,there is a error

系统资源不足。 有关详细信息,请参阅以下堆栈追踪。 java.lang.OutOfMemoryError: Java heap space at java.util.jar.Manifest$FastInputStream.(Manifest.java:315) at java.util.jar.Manifest$FastInputStream.(Manifest.java:310) at java.util.jar.Manifest.read(Manifest.java:178) at java.util.jar.Manifest.(Manifest.java:52) at java.util.jar.JarFile.getManifestFromReference(JarFile.java:165) at java.util.jar.JarFile.getManifest(JarFile.java:146) at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:693) at java.net.URLClassLoader.defineClass(URLClassLoader.java:221) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at com.sun.tools.javac.util.J系统资源不足。有关详细信息,请参阅以下轨迹。 java.lang.OutOfMemoryError: Java heap space at java.util.jar.Manifest$FastInputStream.Manifest.java:315) at java.util.jar.Manifest$ FastInputStream.(Manifest.java:310) at java.util.jar.Manifest.read(Manifest.java:178) at java.util.jar.Manifest.(Manifest.java:52) at java.util.jar.JarFile .getManifestFromReference(JarFile.java:165) at java.util.jar.JarFile.getManifest(JarFile.java:146) at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:693) at java.net.URLClassLoader .defineClass(URLClassLoader.java:221) 在 java.net.URLClassLoader.access$000(URLClassLoader.java:56) 在 java.net.URLClassLoader$1.run(URLClassLoader.java:195) 在 java.security.AccessController.doPrivileged(本机方法)在 java.net.URLClassLoader.findClass(URLClassLoader.java:188) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:307) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:252) 在 java .lang.ClassLoader.loadClassInternal(ClassLoader.java:320) 在 com.sun.tools.javac.util.J CDiagnostic.fragment(JCDiagnostic.java:158) at com.sun.tools.javac.comp.Resolve.absentKindName(Resolve.java:1486) at com.sun.tools.javac.comp.Resolve$ResolveError.report(Resolve.java:1581) at com.sun.tools.javac.comp.Resolve.access(Resolve.java:1079) at com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:1214) at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:156) at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:743) at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:42) at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:711) at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:95) at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:87) at com.sun.tools.javac.comp.Enter.complete(Enter.java:472) at com.sun.tools.javac.comp.Enter.main(Enter.java:429) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819) at com.sun.tools.javac.main.JavaCompiler.compile(Java CDiagnostic.fragment(JCDiagnostic.java:158) 在 com.sun.tools.javac.comp.Resolve.absentKindName(Resolve.java:1486) 在 com.sun.tools.javac.comp.Resolve$ResolveError.report(Resolve. java:1581) 在 com.sun.tools.javac.comp.Resolve.access(Resolve.java:1079) 在 com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:1214) 在 com.sun .tools.javac.comp.Annotate.enterAnnotation(Annotate.java:156) at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:743) at com.sun.tools.javac.comp.MemberEnter .access$300(MemberEnter.java:42) 在 com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:711) 在 com.sun.tools.javac.comp.Annotate.flush(Annotate.java :95) 在 com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:87) 在 com.sun.tools.javac.comp.Enter.complete(Enter.java:472) 在 com.sun。 tools.javac.comp.Enter.main(Enter.java:429) 在 com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819) 在 com.sun.tools.javac.main.JavaCompiler。编译(Java Compiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at com.sun.tools.javac.main.Main.compile(Main.java:279) Compiler.java:727) 在 com.sun.tools.javac.main.Main.compile(Main.java:353) 在 com.sun.tools.javac.main.Main.compile(Main.java:279)

[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.927s
[INFO] Finished at: Tue Sep 15 10:28:14 CST 2015
[INFO] Final Memory: 21M/63M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "Maven" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project pmcs: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:

It looks like 512mb is still not enough.看起来 512mb 仍然不够。 Increase the heap memory more.更多地增加堆内存。 Ex:前任:

MAVEN_OPTS=-Xms256m -Xmx1024m

If that don't work, increase more.如果这不起作用,请增加更多。

MAVEN_OPTS=-Xms256m -Xmx2048m

References:参考:

Setting environment variables in Linux using Bash 使用 Bash 在 Linux 中设置环境变量

Setting Java heap space under Maven 2 on Windows 在 Windows 上的 Maven 2 下设置 Java 堆空间

Maven heap space Maven 堆空间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 连接重置错误 - 运行 mvn clean install 以运行功能时 - Connection reset error - when running mvn clean install to run features 为什么某些测试在 mvn clean install 时失败,但在我单独运行时却没有? - Why some tests fail when mvn clean install but not when I run them individually? 每次运行 mvn clean install 时,我都会遇到一个非常烦人的错误 - I keep getting a really annoying error everytime I run mvn clean install 如何在Intellij中运行“mvn install:install-file” - How Do I Run “mvn install:install-file” in Intellij 当我使用`mvn hpi:run`时有一个ArrayIndexOutOfBoundsException - There is a ArrayIndexOutOfBoundsException when I use `mvn hpi:run` MVN全新安装错误 - Mvn clean install error 当您运行mvn install时会发生什么? - What exactly happens when you run mvn install? 为什么我在运行mvn clean install时有errorRebind结果'javax.validation.ValidatorFactory'必须是一个类? - Why I have errorRebind result 'javax.validation.ValidatorFactory' must be a class when i run mvn clean install? mvn清除警告和mvn安装错误 - mvn clean warning and mvn install error 我在OS X Mavericks上运行mvn时出现以下错误:无法运行程序“/ bin / sh”:error = 2,没有这样的文件或目录 - I am getting the following error when I run mvn on OS X Mavericks: Cannot run program “/bin/sh”: error=2, No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM