FOP 0.92 XP Pro Java 1.5.0_6 I’m trying to run the FOP batch file to create pdf
from a folder other than the ..\FOP folder where the other fop files are
located. My batch file is below. I have hard-coded some of the
input variables to limit errors, but I get “Exception in thread "main"
java.lang.NoClassDefFoundError: org/apache/fop/cli/Main”, which I think
means it can’t find the fop.jar file. I change the current folder with “cd %local_fop_home%
thinking that this will start things in the right folder, but no joy. When I run this batch file from the FOP folder, it works ok. Can anyone tell me what I am doing wrong? Rick @echo off set FOP_FILE=%1 set XML_FILE=%2 set XSL_FILE=%3 set PDF_FILE=%4 set ERR_FILE=%5 set LOCAL_FOP_HOME=C:\DELPHI~1\LVSPRO~1\SEEDPA~1\FOP set LIBDIR=%LOCAL_FOP_HOME%\lib cd %local_fop_home% set LOCALCLASSPATH=%LOCAL_FOP_HOME%build\fop.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-sandbox.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LOCAL_FOP_HOME%build\fop-hyph.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xml-apis-1.3.02.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar rem set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\Saxon8.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\Saxon8-dom.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.6.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.0.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.1.jar set
LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jimi-1.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_core.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\jai_codec.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\fop-hyph.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%FOP_HYPHENATION_PATH% rem need to use Saxon8 so we can do a XSLT2.0 transform on
the xml rem include Saxon8.jar and Saxon8-dom.jar in the classpath
and put in FOP\lib folder rem also use the -Djavax... to assign the TransformerFactory
to Saxon below java -cp "%LOCALCLASSPATH%"
-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl org.apache.fop.cli.Main -xml %tmp%\primavera\test.xml -xsl
%tmp%\primavera\test.xsl -pdf %tmp%\primavera\test.pdf pause |
- running FOP.bat from another folder Rick Roen
- Re: running FOP.bat from another folder Roland Neilands