在ant任务中指定jvm参数

在ant任务中指定jvm参数

问题描述:

我要指定jvm参数是因为我要摆脱堆空间异常,所以只是为了避免在我的ant目标中指定以下参数,如下所示.

I am specifying jvm arguments since i was getting out of heap space exception so just to avoid that i was specifying the below parameters in my ant target that is as shown below..

  <junit
   printsummary="true"
   fork="yes"
   haltonfailure="false"
   failureproperty="junitsFailed"
   errorProperty="junitsFailed"
  >
   <jvmarg value=" -Xmx1024m -Duser.timezone=GMT0"/>
  </junit>

但是在下面,我得到了以下异常..

but below i am getting the below exception ..

that is the invalid parameters are specified

使用多个<jvmarg>元素:

<junit printsummary="true" fork="yes" haltonfailure="false" failureproperty="junitsFailed" errorProperty="junitsFailed">
    <jvmarg value="-Xmx1024m"/>
    <jvmarg value="-Duser.timezone=GMT0"/>
</junit>