Re: Error importing external jar in a custom component
I tried to import the class in the Import section, but it didn't work. I always get the same error:
ERROR in /home/Apps/Talend/Talend6.5/workspace/.JETEmitters/src/org/talend/designer/codegen/translators/insideboard/TZenkoUploadBeginJava.java (at line 14) import okhttp3.OkHttpClient; ^^^^^^^ The import okhttp3 cannot be resolved
Hi
Make sure you have declared the related jar information in the component xml file.
<CODEGENERATION>
<IMPORTS>
<IMPORT NAME="jar label" MODULE="the related jar name.jar" REQUIRED="true"/>
</IMPORTS>
</CODEGENERATION>
And put the jar file in the component folder.
Last, import the class in the import section.
in the Import section:
<%@ jet
imports="
org.talend.core.model.process.INode
org.talend.core.model.process.ElementParameterParser
org.talend.designer.codegen.config.CodeGeneratorArgument
java.util.Map
java.util.List
okhttp3.OkHttpClient
"
%>