zoukankan      html  css  js  c++  java
  • Ant编译项目资源不足

    今天用ant编译项目出现 [javac] 系统资源不足。的错误,如下

    Buildfile: build.xml

    -compile:
        [javac] Compiling 919 source files to E:\DSHR\dshr\WebContent\WEB-INF\classes
        [javac]
        [javac]
        [javac] 系统资源不足。
        [javac] 有关详细信息,请参阅以下堆栈追踪。
        [javac] java.lang.OutOfMemoryError: Java heap space

    看来是内存不足,给设置大一点

        <target name="-compile">
            <javac srcdir="${srcdir}"  destdir="${builddir}" memorymaximumsize="500M" includes="**/*.java" classpathref="class_path">
                <compilerarg value="-Xlint:unchecked"/>             
            </javac>
        </target>
    在编译出现下面的错误
    Buildfile: build.xml

    -compile:
        [javac] Compiling 919 source files to E:\DSHR\dshr\WebContent\WEB-INF\classes
        [javac] Since fork is false, ignoring memoryMaximumSize setting.
        [javac]
        [javac]
        [javac] 系统资源不足。
        [javac] 有关详细信息,请参阅以下堆栈追踪。
        [javac] java.lang.OutOfMemoryError: Java heap space

    Since fork is false, ignoring memoryMaximumSize setting.这句话应该是因为fork是false所以我设置的memoryMaxmumSize就被忽略了,继续修改
        <target name="-compile">
            <javac srcdir="${srcdir}"  destdir="${builddir}" fork="true" memorymaximumsize="500M" includes="**/*.java" classpathref="class_path">
                <compilerarg value="-Xlint:unchecked"/>             
            </javac>
        </target>
    再用ant编译,通过了。

    说明:在Ant的文档中(默认为%ANT_HOME%/docs/manual/index.html)可以查看Ant Tasks 里面列出了不少任务其中javac在Compile Tasks中
    点击javac可以查看更多的参数信息

  • 相关阅读:
    ionic文档
    Can't resolve all parameters for Storage: (?).
    cannot find module @ionicapp-scriptsinionic-app-scripts.js
    ionic 环境搭建
    学习文档记录
    js 文件引用传递参数
    No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
    js 去除左右空格
    sql 多行数据合并
    filter @Autowired nullPointer
  • 原文地址:https://www.cnblogs.com/interboy/p/1243265.html
Copyright © 2011-2022 走看看