Add external jars to classpath of the .bat/.sh script generated

One Star

Add external jars to classpath of the .bat/.sh script generated

Hi Team,
I'm using Talend Open Studio for Data Integration version 5.5.1 in my ETL project. Here I have routine which is using an API developed by myself and that API is using some external jars. That API has been exported as a jar file and add as an external lib to the routine. But when I'm running the build job suing .bat file I'm getting NoClassDefFound exception from the class of the API. That is because it cannot resolve the external jars using in that class. 
If I manually add those external jars to the lib folder and manually edit the classpath of the .bat script it works. Is there any way to resolve this issue rather manually editing the .bat file? Is it possible to include those external jars so that they will be automatically picked up in building the job and classpath is also generated accordingly? 

Thanks and Regards,


Re: Add external jars to classpath of the .bat/.sh script generated

You can not create jar file in talend.
Have you tried to use tlibraryload to load external jars into your job?
Here is the component reference about:TalendHelpCenter:tLibraryLoad
Best regards
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Add external jars to classpath of the .bat/.sh script generated

Hi Sabrina

Thank you for your reply. 

Here I'm not using Talend to create jar files. I'm using Eclipse for that purpose. I cannot use tLibraryLoad component since it does not allow to add multiple jars.

I have sorted out the issue by adding all the dependency jars as external jars to the Routine that I'm using in the Talend. With this approach when a job is built it copies all my external jars to the lib folder and add them to the classpath of the .bat/.sh scripts. 

Thanks and Regards,


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.