Two issues encountered with Maven install today (heap overflow and compilation errors)

Source: Internet
Author: User

1. Maven install appears with the following log:

Insufficient system resources.
For more information, see the following stack trace.

Java.lang.OutOfMemoryError:Java Heap space at Com.sun.tools.javac.util.List.prepend (list.java:145) at COM.S Un.tools.javac.jvm.ClassReader.openArchive (classreader.java:1457) at Com.sun.tools.javac.jvm.ClassReader.list ( classreader.java:1742) at Com.sun.tools.javac.jvm.ClassReader.listAll (classreader.java:1882) at Com.sun.tool S.javac.jvm.classreader.fillin (classreader.java:1903) at Com.sun.tools.javac.jvm.ClassReader.complete ( classreader.java:1538) at Com.sun.tools.javac.code.Symbol.complete (symbol.java:355) at COM.SUN.TOOLS.JAVAC.C Omp. Enter.visittoplevel (enter.java:256) at Com.sun.tools.javac.tree.tree$toplevel.accept (Tree.java:382) at COM.S Un.tools.javac.comp.Enter.classEnter (enter.java:221) at Com.sun.tools.javac.comp.Enter.classEnter (enter.java:235 ) at Com.sun.tools.javac.comp.Enter.complete (enter.java:444) at Com.sun.tools.javac.comp.Enter.main (Enter.ja va:429) at Com.sun.tools.javac.maiN.javacompiler.compile (javacompiler.java:404) at Com.sun.tools.javac.main.Main.compile (main.java:592) at COM . Sun.tools.javac.main.Main.compile (main.java:544) at Com.sun.tools.javac.Main.compile (main.java:92) at SUN.R Eflect. NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( Nativemethodaccessorimpl.ja at Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccesso at JA Va.lang.reflect.Method.invoke (method.java:592) at Org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess (Javac at        Org.codehaus.plexus.compiler.javac.JavacCompiler.compile (Javaccompiler. At Org.apache.maven.plugin.AbstractCompilerMojo.execute (Abstractcompilermo at Org.apache.maven.plugin.CompilerMojo.execute (compilermojo.java:114) at Org.apache.maven.plugin.DefaultPluginManager.executeMojo (DEFAULTPLUGINM at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoaLS (defaul at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLife at Org.apache.maven.lif Ecycle. Defaultlifecycleexecutor.executegoal (Default at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandl at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (Defaultlife at Org.apache.maven.plugin.AbstractCompilerMojo.execute (Abstractcompilermo at Org.apache.maven.plugin.CompilerMojo.execute (compilermojo.java:114) at Org.apache.maven.plugin.DefaultPluginManager.executeMojo (DEFAULTPLUGINM at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (Defaul ... More[info]------------------------------------------------------------------------[INFO] total Time:2 minutes 34 Seconds[info] finished at:wed Jul 17:22:53 CST 2011[info] Final Memory:60m/63m[info]-------------------------------- ---------------------------------------- 

  

cause Analysis: virtual machine heap Overflow, default only 63M, the project is more prone to this problem

Solution: in the MAVEN startup script (Mvn.bat), reset the heap size (set maven_opts=-xms128m-xmx512m)

Issue 2:This issue occurs with Maven install, the log is as follows:

[INFO] Traceorg.apache.maven.BuildFailureException:Compilation failure at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (defaultlifecycleexecutor.java:699) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (defaultlifecycleexecutor.java:540 ) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (defaultlifecycleexecutor.java:519) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (Defaultlifecycleexecutor.java : 371) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (Defaultlifecycleexecutor.java : 332) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (defaultlifecycleexecutor.java:181) at Org.apache.maven.DefaultMaven.doExecute (defaultmaven.java:356) at Org.apache.maven.DefaultMaven.execute ( defaultmaven.java:137) at Org.apache.maven.cli.MavenCli.main (mavencli.java:356) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativEmethodaccessorimpl.invoke (nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced (launcher.java:315) at Org.codehaus.classworlds.Launcher.launch ( launcher.java:255) at Org.codehaus.classworlds.Launcher.mainWithExitCode (launcher.java:430) at Org.codehaus.classworlds.Launcher.main (launcher.java:375) caused by: Org.apache.maven.plugin.CompilationFailureException:Compilation failure at Org.apache.maven.plugin.AbstractCompilerMojo.execute (abstractcompilermojo.java:516) at Org.apache.maven.plugin.CompilerMojo.execute (compilermojo.java:114) at Org.apache.maven.plugin.DefaultPluginManager.executeMojo (defaultpluginmanager.java:483) at Org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (defaultlifecycleexecutor.java:678)

  

Cause Analysis: compilation does not pass, check JDK version

Solution: Use the correct JDK version, and development-time consistency

Two issues encountered with Maven install today (heap overflow and compilation errors)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.