Ant编译失败Java heap space

  •   Eclipse Ant编译出现内存不足,常见错误,提示如下:
Buildfile: F:\workspace\javaee\myapp\build.xml
init:
prepare:
     [echo] Preparing target directory 'F:\workspace\javaee\myapp/build/psmis'
    [mkdir] Created dir: F:\workspace\javaee\myapp\build\psmis
    [mkdir] Created dir: F:\workspace\javaee\myapp\build\psmis\WEB-INF
    [mkdir] Created dir: F:\workspace\javaee\myapp\dist\webapps
hibernatedoclet:
[hibernatedoclet] (XDocletMain.start                   48  ) Running <hibernate/>
[hibernatedoclet] Java heap space
[hibernatedoclet] ParameterImpl instances:   20
[hibernatedoclet] MethodImpl instances:      6849
[hibernatedoclet] ConstructorImpl instances: 299
[hibernatedoclet] SimpleNode instances:      0
[hibernatedoclet] SourceClass instances:     406
[hibernatedoclet] XDoc instances:            0
[hibernatedoclet] DefaultXTag instances:     0
[hibernatedoclet] BinaryClass instances:     70
[hibernatedoclet] UnknownClass instances:    67
[hibernatedoclet] Total memory:    63
[hibernatedoclet] Free memory:    0
[hibernatedoclet] Try to increase heap size. Can be done by defining ANT_OPTS=-Xmx640m
[hibernatedoclet] See the JDK tooldocs.

BUILD FAILED
F:\workspace\javaee\myapp\build.xml:237: Java heap space

Total time: 16 seconds

 

 

 

  •  根据提示信息,增加堆空间大小,修改Eclipse VM参数:-Xmx640m;修改路径:Window-->Preferences-->Java-->Installed JREs-->选中的JRE-->Edit...


     
      
  •  如果要在命令行中执行Ant,则需要在操作系统增加环境变量ANT_OPTS=-Xmx640m
    F:\workspace\javaee\myapp>set ANT_OPTS=-Xmx640m
     

     
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值