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] The import cannot be resolved

Hello,
I am learning how to use tJavaFlex component. In advanced settings I try to do import of some classes:

import org.json.*;
and I get error "The import org.json cannot be resolved".

I can see that json-simple-1.1.jar is in my calsspath variables (Windows > Preferences > Java > Build Path > Classpath Variables).

I've also tried to add my own json jar to user libraries (Windows > Preferences > Java > Build Path > User Libraries and received same error. I tried dropping my json jar into workspace/Java/lib, to studio/workspace/talen_local_project/libs and to Runtime_ESBSE/lib - did not help. Of course, every time I dropped json jar into a folder I restarted Talend studio. 
I also tried to install this jar as a module - it did not go well either.

I am using Talend Open Studio 6.0 for ESB.

Please help to make java import work!
Thank you!
Svetlana

0683p000009MBqy.png 0683p000009MBdl.png 0683p000009MBi8.png
Labels (6)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Using a tLibraryLoad component to load external jar file before you use it.
tLibraryLoad
   |
onsubjobok
   |
tJavaFlex
Best regards
Shong

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Using a tLibraryLoad component to load external jar file before you use it.
tLibraryLoad
   |
onsubjobok
   |
tJavaFlex
Best regards
Shong
Anonymous
Not applicable
Author

Thank you Shong! Does it mean that I have to do it for every job if I want all of them to have access to the same external library? Is it possible to setup my environment so that all my jobs have access to this library by default without having to introduce this extra component tLibraryLoad?
Thank you,
Svetlana
Anonymous
Not applicable
Author

Yes,  you have to load the jar with tLibararyLoad component in each independent job. Alternatively, if you need to use these same code many time in different job, I would suggest you to create a routine and import external library one time in repository metadata, and call the routine in the job. Please refer to this article to learn how to create a routine and call it in a job.
Shong
Anonymous
Not applicable
Author

Thank you very much Shong!