When I try to call a java program from my batch script like that:
java -jar %PATH_TO_BATIK%batik-rasterizer.jar -w 72 -h 72 -dpi 240 -d %2%\hdpi -m %MIME_TYPE% %1%
The command fails. When I echo the above command the following gets printed to the screen:
echo java -jar %PATH_TO_BATIK%batik-rasterizer.jar -w 72 -h 72 -dpi 240 -d testMIME_TYPE1
where %2% is test and %1% is book.svg.
How do I format the command so that it works?
I assume you are using windows. In windows you can use %1 through %9 as batch parameters and these correspond to the arguments you pass in via the command line.
Notice they only use 1 percentage sign.
A value with a percentage sign at each end (e.g. %MIME_TYPE%) is an environmental variable and will either have to exist in the environment prior to the batch file being called or alternatively set inside the batch file itself.
If I call the above batch file like this:
I get:
I hope this helps.