Java routine: import cannot be resolved. Path looks ok (?)

One Star

Java routine: import cannot be resolved. Path looks ok (?)

Hi,
I'm trying to integrate my Job with POJO code colleagues have written. I've imported this code as an 'External Class Folder', and can see it when browsing .Java projects (screenshot JavaBrowsing_.java_Projects) and also in the Build path (screenshot Preferences_Java_BuildPath)
When I'm writing the import statement, Eclipse can find the right class (screenshot Define_Import_Stmt) but the compiler cannot resolve it (screenshot Import_Stmt_Error).
Any suggestions as to where I'm going wrong?
Thanks,
Colm.
One Star

Re: Java routine: import cannot be resolved. Path looks ok (?)

Got a bit closer; I put the code into a Jar and imported this into Modules and that shows up in the Modules list with Status = Unused. How do I install it? (get it into an Installed state).
Thanks,
Colm.

Re: Java routine: import cannot be resolved. Path looks ok (?)

Talend and Eclipse are not quite that tightly integrated. Use a tLibraryLoad component to import the external jar in a job.
One Star

Re: Java routine: import cannot be resolved. Path looks ok (?)

Have you tried right-clicking on the NumberValidator routine in the Repository and selecting "Edit Routine Libraries"?
One Star

Re: Java routine: import cannot be resolved. Path looks ok (?)

That's it, thanks ("Edit Routine Libraries"). Found documentation (section 8.4.3 of TalendIntegrationSuite_TE_Studio_UG_41b_EN.pdf). Looks like there's no need to mess with Java build paths (for this anyway). Still thinking too much like a Java developer!
Thanks again.
One Star

Re: Java routine: import cannot be resolved. Path looks ok (?)

Just as a follow-up, it would be nice if you could add a .war file as a routine library -- that way you wouldn't need to add several jars that your code depends on (e.g. logging, 3rd party libs...)
I tried this: renamed mywar.war to mywar.zip, then tried to add mywar.zip via Edit Routine Libraries, but it looks like it doesn't work.
Has anyone succeeded using a .war as a routine library?
One Star

Re: Java routine: import cannot be resolved. Path looks ok (?)

You can always pack your own JAR with a simple zip tool. Extract all the JARs from /WEB-INF/lib (an any /WEB-INF/classes) into a common directory and zip that up. You may need to merge /META-INF/MANIFEST.MF files.