One Star

importing ini4j.jar and using it

Hi,
Because i'd like to read an ini file, i have to use a tJava and the ini4j library.
I installed ini4j through the "modules" tab of my job.
Once it has been installed, the message "unused" was indicated. Is it wrong?
In my tJava, in the advanced setting tab, i typed import java. but it didn't find my ini4j.
How to import my ini4j library correctly and use it in my tJava?
I searched the forum but found it hard to get the solution.
Thanks a lot!
The java code will be

FOR (Ini.Section section : ini.VALUES())
{
System.out.println("");
FOR (String OPTION : section.keySet())
{
System.out.println(OPTION + " = " + section.fetch(OPTION));
}

System.out.println();
}

(taken from http://www.talendforge.org/bugs/view.php?id=7415)
1 REPLY
Community Manager

Re: importing ini4j.jar and using it

Hello
To import a external jar, you should use the tLibraryLoad component. eg:
tLibraryLoad
|
onsubjobok
|
tJava
on tJava, you can use the class like this:
pakcageName.className ins=new packageName.className();
ins.methodName();
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business