Processing from the Java command line

Under certain circumstances it may be desirable to run the Toolkit build code by invoking the Java JVM from the command line instead of by invoking Ant. The Toolkit provides a way to do this by supporting a set of command-line parameters. When invoking the Toolkit build code from the Java command line, the inputs to Ant are stored in a temporary file by the Toolkit Java code, and then Ant is invoked to carry out the build.

Note: When using the Java command line, you still must have Ant installed.

Running a Java command line example

  1. Go to the DITA Open Toolkit installation directory.
  2. On the command line, enter the following command:
    java -jar lib/dost.jar /i:samples/sequence.ditamap /outdir:out /transtype:xhtml
This example creates a properties file, and then calls Ant using this properties file to build the garage sample sequence.ditamap file and produce XHTML output to the out directory.
Note:
  • In this example, the character slash preceded by a space is the separator for each parameter.
  • The internally generated properties file is saved in the ${args.logdir} directory. The following command shows an example of using this properties file with Ant:
    ant -f conductor.xml -propertyfile ${args.logdir}/property.temp

Supported parameters

Parameters supplied on the Java command line are equivalent to similar parameters used in Ant build scripts. The Ant build script parameters are described in Ant processing parameters. The following table lists the parameters you can provide on the Java command line and the equivalent parameter that can be supplied in an Ant build script.

Java parameter Equivalent Ant script parameter
/artlbl args.artlbl
/basedir basedir
/cleantemp clean.temp
/copycss args.copycss
/css args.css
/cssroot args.cssroot
/csspath args.csspath
/ditalocale args.dita.locale
/draft args.draft
/ditadir dita.dir
/ditaext dita.extname
/eclipsecontenttoc args.eclipsecontent.toc
/eclipsehelptoc args.eclipsehelp.toc
/filter args.input.valfile
/fouserconfig args.fo.userconfig
/foimgext args.fo.img.ext
/fooutputrellinks args.fo.output.rel.links
/ftr args.ftr
/hdf args.hdf
/hdr args.hdr
/htmlhelpincludefile args.htmlhelp.includefile
/i args.input
/id dita.input.dirname
/if dita.input
/indexshow args.indexshow
/javahelpmap args.javahelp.map
/javahelptoc args.javahelp.toc
/logdir args.logdir
/outdir args.outdir
/outext args.outext
/provider args.eclipse.provider
/tempdir dita.temp.dir
/transtype transtype
/version args.eclipse.version
/xhtmltoc args.xhtml.toc
/xsl args.xsl