title: FOP batik NoClassDefFoundError: org/apache/batik/bridge/UserAgent
body: <p>I do not use maven, or pom or anything. I just have simple test class for testing and I just try to make XSL-FO to PDF conversion and I get this error.
  The code is simple:</p>
  
  <pre><code>package testing;
  
  import java.io.BufferedOutputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.InputStream;
  import java.io.OutputStream; 
  
  import javax.xml.transform.Source;
  import javax.xml.transform.Transformer;
  import javax.xml.transform.sax.SAXResult; 
  
  import javax.xml.transform.Result; 
  import javax.xml.transform.TransformerFactory; 
  import javax.xml.transform.stream.StreamSource; 
  
  import org.apache.fop.apps.Fop; 
  import org.apache.fop.apps.FopFactory; 
  
  import org.apache.xmlgraphics.util.MimeConstants;
  
  
      public class test {
  
      public static void main(String[] args) {
          String pth="C:/Temp/";
          FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
          TransformerFactory factory = TransformerFactory.newInstance();
          OutputStream out;
          try
          {   
          out = new BufferedOutputStream(new FileOutputStream(new File(pth+"myfile.pdf")));
  
          InputStream in = new FileInputStream(pth+"everything.fo");
  
          Source source = null;
          Transformer transformer = factory.newTransformer();
          source = new StreamSource(in);      
          Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
          Result res = new SAXResult(fop.getDefaultHandler());
          transformer.transform(source, res);         
          } catch (Exception e)
          {
              e.printStackTrace();;
          }       
      }
  }
  </code></pre>
  
  <p>And this is result:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/batik/bridge/UserAgent
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
      at java.lang.Class.getConstructor0(Class.java:3075)
      at java.lang.Class.getDeclaredConstructor(Class.java:2178)
      at org.apache.xmlgraphics.util.Service.providers(Service.java:85)
      at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.discoverClasspathImplementations(ImageImplRegistry.java:115)
      at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.&lt;init&gt;(ImageImplRegistry.java:79)
      at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.&lt;init&gt;(ImageImplRegistry.java:87)
      at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.&lt;clinit&gt;(ImageImplRegistry.java:71)
      at org.apache.xmlgraphics.image.loader.ImageManager.&lt;init&gt;(ImageManager.java:64)
      at org.apache.fop.apps.FopFactoryBuilder$FopFactoryConfigImpl.&lt;init&gt;(FopFactoryBuilder.java:381)
      at org.apache.fop.apps.FopFactoryBuilder.&lt;init&gt;(FopFactoryBuilder.java:90)
      at org.apache.fop.apps.FopFactoryBuilder.&lt;init&gt;(FopFactoryBuilder.java:81)
      at org.apache.fop.apps.FopFactoryBuilder.&lt;init&gt;(FopFactoryBuilder.java:71)
      at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:143)
      at testing.test5.main(test5.java:37)
  Caused by: java.lang.ClassNotFoundException: org.apache.batik.bridge.UserAgent
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 16 more
  </code></pre>
  
  <p>Here are my libs:
  <a href="https://i.stack.imgur.com/qsgfy.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/qsgfy.jpg" alt="My Libs"></a></p>
  
  <p>What do I do wrong?
  As I said I don't use POM, MAVEN etc., just simple java code for testing purpose. I know that there is some dependencies but without POM how I can manage this things?</p>
  
  <p>Here is my FO file:
  <a href="https://ufile.io/bgm07" rel="noreferrer" title="everything.fo">everything.fo</a></p>