Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (3)
1 Reply
Anonymous
Not applicable
Author

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
"
%>

Regards
Shong