You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jakob <ja...@jfix.com> on 2004/04/23 11:56:06 UTC

task: Unrecognized option: -jar bin/exist/start.jar?

Hi,

I am getting an "Unrecognized option" error while trying
to use the <exec> task.

[I am currently exploring all possible methods to use Ant
to store XML documents in eXist, i.e. also the <java> task
and eXist's own <xmldb:store> task, and have a lot of
trouble.  If somebody has done this successfully, please
let me know.]

The target:
----------
<target name="store-cmdline">
 <exec executable="${basedir}\bin\jre\bin\java.exe">
  <arg value="-Dexist.home=${exist.home}"/>
  <arg value="-jar ${exist.home}/start.jar"/>
  <arg value="client"/>
  <arg value="-l"/>
  <arg value="-m /db/imo/codes/fss/fss2001/doc"/>
  <arg value="-p ${basedir}\data\imo\codes\fss\fss2001\doc"/>
 </exec>
</target>

The error:
---------
E:\cvs_out\dy_v0.4>ant -v -buildfile buildexist.xml
store-cmdline
Unable to locate tools.jar. Expected to find it in
E:\cvs_out\dy_v0.4\bin\lib\tools.jar
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: buildexist.xml
Detected Java version: 1.4 in: E:\cvs_out\dy_v0.4\bin\jre
Detected OS: Windows 2000
parsing buildfile E:\cvs_out\dy_v0.4\buildexist.xml with
URI = file:///E:/cvs_out/dy_v0.4/buildexist.xml
Project base dir set to: E:\cvs_out\dy_v0.4
parsing buildfile
jar:file:E:\cvs_out\dy_v0.4\bin\exist\exist-optional.jar!/org/exist/ant/antlib.xml
with URI = jar:file:E:\cvs_out\dy_v0.4\bin\exist\
exist-optional.jar!/org/exist/ant/antlib.xml
Build sequence for target `store-cmdline' is [store-cmdline]
Complete build sequence is [store-cmdline, store-java,
store-native, ]

store-cmdline:
     [exec] Current OS is Windows 2000
     [exec] Executing
'E:\cvs_out\dy_v0.4\bin\jre\bin\java.exe' with
arguments:
     [exec] '-Dexist.home=bin/exist'
     [exec] '-jar bin/exist/start.jar'
     [exec] 'client'
     [exec] '-l'
     [exec] '-m /db/imo/codes/fss/fss2001/doc'
     [exec] '-p
E:\cvs_out\dy_v0.4\data\imo\codes\fss\fss2001\doc'
     [exec]
     [exec] The ' characters around the executable and
arguments are
     [exec] not part of the command.
     [exec] Unrecognized option: -jar bin/exist/start.jar
     [exec] Could not create the Java virtual machine.

     [exec] Result: 1
BUILD SUCCESSFUL


Thank you,
Jakob.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: task: Unrecognized option: -jar bin/exist/start.jar?

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 23 Apr 2004, <ja...@jfix.com> wrote:

> I am getting an "Unrecognized option" error while trying
> to use the <exec> task.

[...]

>   <arg value="-jar ${exist.home}/start.jar"/>

passes "-jar ${exist.home}/start.jar" as a single argument and Java
doesn't understand it that way.  You either want

  <arg line="-jar ${exist.home}/start.jar"/>

or

  <arg value="-jar"/>
  <arg value="${exist.home}/start.jar"/>

or directly use the <java> task instead.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org