> From: Salman, Afzal [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 19 June 2001 11:00 AM
> To: Ant-User (E-mail)
> Subject: Translating exec to java!
>
>
> I translated following command into ANT:-
>
> java -classpath %WL_HOME%/lib/weblogic_sp.jar;%WL_HOME%/lib/weblogic.jar
> weblogic.ejbc -compile javac input_app.jar output_app.jar
>
> as follows.  It works fine when I translate it into Ant as
> follows using the
> exec:
>
> <target name="createEjb" depends="package_ejb">
>   <exec dir="${APP_DIR}" executable="java" >
>     <arg line="-classpath ${wl_jar1};${wl_jar2};${PLATFORM_CLASSPATH}
> ${wl_ejbc} -compiler javac ${in_jar} ${out_jar}"/>
>   </exec>
> </target>
>
> But it does not work when I use java as follows as the output_app.jar is
> only 1KB.
>
> <target name="createEjb_jar" depends="package_ejb">
>   <java fork="yes" classpath="${wl_jar1}:${wl_jar2}"
> output="output_app.jar"
> classname="weblogic.ejbc" >
>       <arg value="-compile javac input_app.jar"/>
>   </java>
> </target>
>

Afzal,

The use of the output attribute for <java> is incorrect. This will take the
output, ie. the messages, generated by javac and put them in a file. It
won't be a jar. Your arg lines are different - you are using "-compiler" in
one and "-compile" in another. Finally, you need to use either an <arg line>
in the <java> command, similar to what you have done for the <exec>, or you
need to use multiple <arg value> elements, one per argument.

Have a read here
http://jakarta.apache.org/ant/manual/using.html#arg


>

Reply via email to