Use external jar in a job

One Star

Use external jar in a job

Hi,
I would like to run an external jar from a tSystem component (java -jar test.jar)
I tried to create a routine and add the jar as dependency (Add routine libraries). But when I publish the job, the jar will be moved into a folder under /.../TalendJobServersFiles/cache/lib/ and I don't know the path to be able to run the job.
Is there a posibility to have test.jar file in the job deployment folder (under /.../TalendJobServersFiles/repository/)?
Should I add the dependency in other way?
Thank you
Moderator

Re: Use external jar in a job

Hi fata_n_rosu,
Have you checked TalendHelpCenter:tLibraryLoad to load external jars?
Using tLibraryload component to load the jar file at the begininig of job. for example:
tLibraryLoad
   |
tJava(on tJava, use the external API)


Best regards
Sabrina
--
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: Use external jar in a job

And if I don't want to use the external API but the jar file itself?
Where tLoadLibrary will store the jar file?
Moderator

Re: Use external jar in a job

Hi,
And if I don't want to use the external API but the jar file itself?
Where tLoadLibrary will store the jar file?

Your jar file disapper after it is loaded into job?
Best regards
Sabrina
--
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: Use external jar in a job

When I publish the job to a remote job server the jar is copied into into a folder under /.../TalendJobServersFiles/cache/lib. And the folder name is autogenerated. Which is the best way to use this jar into a tSystem component?