-2

系统资源不足。 有关详细信息,请参阅以下堆栈追踪。 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.JCDiagnostic.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(JavaCompiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at 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:
Harwin
  • 3
  • 1
  • I searched the problem in the internet,it tells me to edit the mvn file in the bin directory,and add the following to the file set MAVEN_OPTS=-Xms256m -Xmx512m but it didn't work at all. help –  Harwin Sep 15 '15 at 02:56
  • Can you please post the full output of the error message... – khmarbaise Sep 15 '15 at 18:00

1 Answers1

0

It looks like 512mb is still not enough. 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

Setting Java heap space under Maven 2 on Windows

Maven heap space

Community
  • 1
  • 1
shan1024
  • 1,389
  • 7
  • 17