how to call external Java application in talend?

One Star

how to call external Java application in talend?

Hi all,
We implemented one logic with java code,this is located in eclipse.
I want to call external java code in Talend, then the java code is execute in eclipse.
how to call external java code in talend?
Thanks in Advance.
Seventeen Stars

Re: how to call external Java application in talend?

have a look at :
PS : Don't forget to use search Talend forum option OR Talend help center ... there are a lot of great informations about Talend. Smiley Happy
Five Stars

Re: how to call external Java application in talend?

Hi Kumar,
Please find below some steps that you can use to get a Talend based job called from within Eclipse.
You will want to use the 'Export Job' option on the job you want to call. This will create the jar files needed to call the java class. Once you have done that, unzip the file and copy the jar files in a folder that resides within an Eclipse project. We use a project to hold jar files from external sources which these are.
Once you have the jar files copied to your Eclipse workspace, add the jar files to the classpath (aka buildpath) of the project that holds the class that will be calling your Talend based job.
From here you just need to add a few lines of java code to call your job. See below sample code.
NOTE: The Sample_TalendJob reference listed below is the name of the job within Talend that you exported.
Also, the below example has a date value being passed in via the argument list.
String[] etlArgs = { "--context=custom", "--context_param processDate=" + processDate };
String returnCode[][];
Sample_TalendJob sampleTalendJob = new Sample_TalendJob();
returnCode = sampleTalendJob.runJob(etlArgs);
if (returnCode.equals("0")) {
// job ran without error
} else {
// job encountered error
Hope the above helps.
Two Stars

Re: how to call external Java application in talend?

Hi , I am already doing the same , but this might be the case that Talend is not throwing the exception in my scenario and is simply writing on to the console . and hence , the exception is not caught.
Thanks for the timely response.

Re: how to call external Java application in talend?

Hi yadavjyoti24,
Have you tried to use  tlogcatcher component in your job? Which can be used to capture exception and log them(console, file or db table ).
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.


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


Downloads and Trials

Test drive Talend's enterprise products.