next up previous contents index
Next: Javac Up: Java Previous: Parameters specified as nested   Contents   Index

Examples

  
       <java classname="test.Main">
         <arg value="-h"/> 
         <classpath>
           <pathelement location="dist/test.jar"/>
           <pathelement path="${java.class.path}"/>
         </classpath>
       </java>
Run a class in this JVM with a new jar on the classpath
  
        <java jar="dist/test.jar" 
           fork="true"
           failonerror="true"
           maxmemory="128m"
           >
         <arg value="-h"/> 
         <classpath>
           <pathelement location="dist/test.jar"/>
           <pathelement path="${java.class.path}"/>
         </classpath>
       </java>
Run the jar using the manifest supplied entry point, forking (as required), and with a maximum memory of 128MB. Any non zero return code breaks the build.
  
  <java classname="test.Main"/>

  <java classname="test.Main"
        fork="yes" >
    <sysproperty key="DEBUG" value="true"/> 
    <arg value="-h"/> 
    <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/> 
  </java>
Note: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the JVM, as it takes different parameters for other JVMs, That JVM can be started from <exec> if required.



Andrew Marlow 2003-07-08