You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mike Bridge <br...@gsnet.com> on 2001/03/16 23:51:55 UTC

Problem with : ends up in wrong place?

I have a problem with the "arg" entity within the "java" tag.  When it
executes the jdk, it places the argument after the target class file, 
rather than before.  Right or wrong, when I run this (at least with 
IBM-JDK1.3), java doesn't recognize that anything has been passed
to it with the "-D" argument.  However, if I type this from the 
command line and put the "-D" BEFORE the class name, it works fine.

I also tried the deprecated "args" attribute, but that has the
same problem.

Is this something that should be fixed within ant?  Or is there
a workaround?

Here's the target from ant:

  <property name="configfileargs" value="-Dmtl.config=file:///home/bridge/gsnet/WEB-INF/edm.dev.properties"/>
...

  <target name="test" depends="compile">
     <java classname="com.gsnet.business.bo.TestIt" dir="." fork="yes">
        <classpath refid="project.class.path"/>
        <arg line="${configfileargs}"/>
     </java>
  </target>


And here's the result from "ant -verbose test"

test:
     [java] Forking java -classpath /home/bridge/gsnet/WEB-INF/classes/com/gsnet/business/bo:/home/bridge/gsnet/WEB-INF/classes:/usr/lib/pgsql/jdbc7.0-1.2.jar:/home/bridge/gsnet/WEB-INF/lib/log4j.jar:/home/bridge/gsnet/WEB-INF/lib/tlabs13.jar com.gsnet.business.bo.TestIt -Dmtl.config=file:///home/bridge/gsnet/WEB-INF/edm.dev.properties

Note that -Dmtl.config comes after "com.gsnet.business.bo.TestIt"....

Thanks,

-Mike

-- 
Mike Bridge
Global Sourcing Network
http://www.gsnet.com/


Re: Problem with : ends up in wrong place?

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message ----- 
From: "Mike Bridge" <br...@gsnet.com>
To: <an...@jakarta.apache.org>
Sent: Friday, March 16, 2001 11:51 PM
Subject: Problem with <ARG>: ends up in wrong place?


> I have a problem with the "arg" entity within the "java" tag.  When it
> executes the jdk, it places the argument after the target class file, 
> rather than before.  Right or wrong, when I run this (at least with 
> IBM-JDK1.3), java doesn't recognize that anything has been passed
> to it with the "-D" argument.  However, if I type this from the 
> command line and put the "-D" BEFORE the class name, it works fine.
> 

Have you tried to use <jvmarg>? 

Nico