tags:

views:

25

answers:

2
<target name="results">
    <echo message="Calculating QI" />   
    <java jar="jmt.jar" fork="true" failonerror="true" maxmemory="1024m" classpath="jmt/jmt">
        <arg value="-name:KIS"/>
        <arg value="-results:CONSOLE"/>
        <arg value="../allJavas.jar"/>
    </java>
</target>

i want from folder tmp run jar file in folder jmt/jmt. It must be run inside jmt/jmt folder becouse of dependencies files.

i can run it like <java jar="jmt/jmt/jmt.jar" but then dependencies files are not ok. I try to use classpath but not working. What i am doing wrong?

+1  A: 

Use the dir="jmt/jmt" attribute to specify the folder to launch the java process in, and use jar="jmt/jmt/jmt.jar" to specify the jar. You probably don't need to classpath attribute at all.

See http://ant.apache.org/manual/Tasks/java.html

developmentalinsanity
+1  A: 

The java ant task takes an option parameter dir="jmt/jmt" that will tell the forked VM where to execute.

KeithL