Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Importing java.util.*

Hello,
I am trying to create a new component, I needed to use an Iterator si I added java.util.* to the imports but it doesn't seem to recognize it.
Part of my code (main part) :
<%@ jet
imports="
org.talend.core.model.process.INode
org.talend.core.model.process.ElementParameterParser
org.talend.core.model.metadata.IMetadataTable
org.talend.core.model.metadata.IMetadataColumn
org.talend.core.model.process.IConnection
org.talend.core.model.process.IConnectionCategory
org.talend.designer.codegen.config.CodeGeneratorArgument
org.talend.core.model.metadata.types.JavaTypesManager
org.talend.core.model.metadata.types.JavaType
org.talend.core.model.process.EConnectionType
java.util.*
"
%>

Iterator<String> i_<%=cid%> = resultat_<%=cid%>.iterator();


When I try to run the component it says Iterator is not recognized.
What am I missing ? Do I need to add something to the .xml ?
thanks !
Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The imports you shows us will be used while creating the job source code.
If you say you run the component I guess you mean you run the job and gets the compilation problem.
Indeed it is from the perspective of a component not possible to add an import to the job source code. Thats because I would use full qualified java classes: for your example:
java.util.Iterator<String> ....

View solution in original post

2 Replies
Anonymous
Not applicable
Author

The imports you shows us will be used while creating the job source code.
If you say you run the component I guess you mean you run the job and gets the compilation problem.
Indeed it is from the perspective of a component not possible to add an import to the job source code. Thats because I would use full qualified java classes: for your example:
java.util.Iterator<String> ....
Anonymous
Not applicable
Author

Okay I get it and now it's working ! Thanks