<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Load a custom jar in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Load-a-custom-jar/m-p/2551140#M149635</link>
    <description>&lt;DIV&gt;Hello,&lt;BR aria-hidden="true" /&gt;We are facing an issue while trying to integrate custom Java classes into a Talend job.&lt;BR aria-hidden="true" /&gt;Context:&lt;BR aria-hidden="true" /&gt;We have two custom Java classes:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;ConvertPdfToImages&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;SupprimerZonesNoiresAvecOcr&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;The first class uses Apache PDFBox to convert a PDF file into PNG images.&lt;BR aria-hidden="true" /&gt;We also have the following dependency: pdfbox-app-3.0.7.jar&lt;/DIV&gt;
&lt;DIV&gt;We created a custom jar containing our Java classes, for example:&amp;nbsp; ocr-pdf-utils.jar&lt;/DIV&gt;
&lt;DIV&gt;This jar contains the following classes: ConvertPdfToImages.class&amp;nbsp; &amp;nbsp;SupprimerZonesNoiresAvecOcr.class&amp;nbsp; &amp;nbsp; &amp;nbsp;Rect.class&lt;/DIV&gt;
&lt;DIV&gt;In the Talend job, we want to call the classes from a &lt;CODE&gt;tJava&lt;/CODE&gt; component, for example:&lt;/DIV&gt;
&lt;DIV&gt;ConvertPdfToImages.main(new String[] { context.chemin_pdf, context.dossier_images }); SupprimerZonesNoiresAvecOcr.main(new String[] {});&lt;/DIV&gt;
&lt;DIV&gt;Issue:&lt;BR aria-hidden="true" /&gt;When we add the custom jar using &lt;CODE&gt;tLibraryLoad&lt;/CODE&gt;, Talend does not recognize the class in the &lt;CODE&gt;tJava&lt;/CODE&gt; component and shows a compilation error such as:&lt;/DIV&gt;
&lt;DIV&gt;ConvertPdfToImages cannot be resolved&lt;/DIV&gt;
&lt;DIV&gt;We also tried to add the Java classes directly as a Talend Routine, but then we have issues with the Apache PDFBox imports, such as:&lt;/DIV&gt;
&lt;DIV&gt;import org.apache.pdfbox.Loader; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.rendering.ImageType; import org.apache.pdfbox.rendering.PDFRenderer;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;DIV&gt;Even when using &lt;CODE&gt;tLibraryLoad&lt;/CODE&gt; to load &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt;, it does not seem to be enough for the Routine or the &lt;CODE&gt;tJava&lt;/CODE&gt; component to compile correctly.&lt;BR aria-hidden="true" /&gt;Questions:&lt;BR aria-hidden="true" /&gt;1. What is the correct way to add a custom jar containing Java classes to a Talend job so that it is recognized at compile time in a &lt;CODE&gt;tJava&lt;/CODE&gt; component?&lt;BR aria-hidden="true" /&gt;2. Where should we add &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt; so that the PDFBox imports are recognized inside a Talend Routine?&lt;BR aria-hidden="true" /&gt;3. Is it better to:&lt;BR aria-hidden="true" /&gt;keep the classes in an external jar,&lt;BR aria-hidden="true" /&gt;convert them into Talend Routines,&lt;BR aria-hidden="true" /&gt;or use another approach such as &lt;CODE&gt;tJavaFlex&lt;/CODE&gt;, routine dependencies, Modules, or the job build path?&lt;BR aria-hidden="true" /&gt;4. Is there any specific Talend Studio configuration required so that both the custom jar and its dependencies are correctly included when generating the job?&lt;BR aria-hidden="true" /&gt;Additional information:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;The Java classes compile correctly outside Talend using &lt;CODE&gt;javac&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;The PDFBox jar used is &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;The custom jar does contain the expected &lt;CODE&gt;.class&lt;/CODE&gt; files.&lt;/LI&gt;
&lt;LI&gt;The main issue seems to be class and dependency visibility at job compile time, not necessarily at runtime.&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;Any suggestions or feedback from similar experiences would be greatly appreciated.&lt;BR aria-hidden="true" /&gt;Thank you.&lt;/DIV&gt;</description>
    <pubDate>Thu, 11 Jun 2026 14:28:41 GMT</pubDate>
    <dc:creator>anyxs</dc:creator>
    <dc:date>2026-06-11T14:28:41Z</dc:date>
    <item>
      <title>Load a custom jar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Load-a-custom-jar/m-p/2551140#M149635</link>
      <description>&lt;DIV&gt;Hello,&lt;BR aria-hidden="true" /&gt;We are facing an issue while trying to integrate custom Java classes into a Talend job.&lt;BR aria-hidden="true" /&gt;Context:&lt;BR aria-hidden="true" /&gt;We have two custom Java classes:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;ConvertPdfToImages&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;SupprimerZonesNoiresAvecOcr&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;The first class uses Apache PDFBox to convert a PDF file into PNG images.&lt;BR aria-hidden="true" /&gt;We also have the following dependency: pdfbox-app-3.0.7.jar&lt;/DIV&gt;
&lt;DIV&gt;We created a custom jar containing our Java classes, for example:&amp;nbsp; ocr-pdf-utils.jar&lt;/DIV&gt;
&lt;DIV&gt;This jar contains the following classes: ConvertPdfToImages.class&amp;nbsp; &amp;nbsp;SupprimerZonesNoiresAvecOcr.class&amp;nbsp; &amp;nbsp; &amp;nbsp;Rect.class&lt;/DIV&gt;
&lt;DIV&gt;In the Talend job, we want to call the classes from a &lt;CODE&gt;tJava&lt;/CODE&gt; component, for example:&lt;/DIV&gt;
&lt;DIV&gt;ConvertPdfToImages.main(new String[] { context.chemin_pdf, context.dossier_images }); SupprimerZonesNoiresAvecOcr.main(new String[] {});&lt;/DIV&gt;
&lt;DIV&gt;Issue:&lt;BR aria-hidden="true" /&gt;When we add the custom jar using &lt;CODE&gt;tLibraryLoad&lt;/CODE&gt;, Talend does not recognize the class in the &lt;CODE&gt;tJava&lt;/CODE&gt; component and shows a compilation error such as:&lt;/DIV&gt;
&lt;DIV&gt;ConvertPdfToImages cannot be resolved&lt;/DIV&gt;
&lt;DIV&gt;We also tried to add the Java classes directly as a Talend Routine, but then we have issues with the Apache PDFBox imports, such as:&lt;/DIV&gt;
&lt;DIV&gt;import org.apache.pdfbox.Loader; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.rendering.ImageType; import org.apache.pdfbox.rendering.PDFRenderer;&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;DIV&gt;Even when using &lt;CODE&gt;tLibraryLoad&lt;/CODE&gt; to load &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt;, it does not seem to be enough for the Routine or the &lt;CODE&gt;tJava&lt;/CODE&gt; component to compile correctly.&lt;BR aria-hidden="true" /&gt;Questions:&lt;BR aria-hidden="true" /&gt;1. What is the correct way to add a custom jar containing Java classes to a Talend job so that it is recognized at compile time in a &lt;CODE&gt;tJava&lt;/CODE&gt; component?&lt;BR aria-hidden="true" /&gt;2. Where should we add &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt; so that the PDFBox imports are recognized inside a Talend Routine?&lt;BR aria-hidden="true" /&gt;3. Is it better to:&lt;BR aria-hidden="true" /&gt;keep the classes in an external jar,&lt;BR aria-hidden="true" /&gt;convert them into Talend Routines,&lt;BR aria-hidden="true" /&gt;or use another approach such as &lt;CODE&gt;tJavaFlex&lt;/CODE&gt;, routine dependencies, Modules, or the job build path?&lt;BR aria-hidden="true" /&gt;4. Is there any specific Talend Studio configuration required so that both the custom jar and its dependencies are correctly included when generating the job?&lt;BR aria-hidden="true" /&gt;Additional information:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;The Java classes compile correctly outside Talend using &lt;CODE&gt;javac&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;The PDFBox jar used is &lt;CODE&gt;pdfbox-app-3.0.7.jar&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;The custom jar does contain the expected &lt;CODE&gt;.class&lt;/CODE&gt; files.&lt;/LI&gt;
&lt;LI&gt;The main issue seems to be class and dependency visibility at job compile time, not necessarily at runtime.&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;Any suggestions or feedback from similar experiences would be greatly appreciated.&lt;BR aria-hidden="true" /&gt;Thank you.&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Jun 2026 14:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Load-a-custom-jar/m-p/2551140#M149635</guid>
      <dc:creator>anyxs</dc:creator>
      <dc:date>2026-06-11T14:28:41Z</dc:date>
    </item>
  </channel>
</rss>

