Could not find or load main class only when running in linux outside talend

Four Stars

Could not find or load main class only when running in linux outside talend

Hello,

I´m using Talend Open Studio for Data Integration (6.5.1) and I have a simple test job with a tJava_1 that only prints a line.

talend_job.PNG

 

When I try to run it in Talend works fine, when I build it and run it in Windows with the .bat file that is generated by Talend , works fine, but when I try to run it in Linux with the .sh file that is generated by Talend I get the error 

Error: Could not find or load main class sharepoint.helloworld_0_1.HelloWorld 

(hello world is my job and sharepoint is my local repository)

 

In the computer where I have talend (with Windows) I'm using java jre1.8.0_161.

In the linux computer I have the same (and I also tried with jdk1.8.0_161)

I configured my JAVA_HOME and PATH in the /etc/profile and I think thats fine, If I do java -version I get this:


java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

 

I also tried to run a HelloWorld made outside talend to see if Java was working fine and it is. So my guessing is that is something when is beeing build for Unix system, but I'm not sure.

 

Do you have any other idea of what could be?

Thanks..


Accepted Solutions
Moderator

Re: Could not find or load main class only when running in linux outside talend

Hello,

Before building your Job, could you please go to Window > Preferences, select Talend > Import/Export, and then select the Add classpath jar in exported jobs check box to wrap the Jars in a classpath.jar file added to the built Job?

Let us know if it is OK with you. And did you select "Java source" check box on the "Build job " window to export the .java file holding Java classes generated by the Job when designing it?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

All Replies
Moderator

Re: Could not find or load main class only when running in linux outside talend

Hello,

Before building your Job, could you please go to Window > Preferences, select Talend > Import/Export, and then select the Add classpath jar in exported jobs check box to wrap the Jars in a classpath.jar file added to the built Job?

Let us know if it is OK with you. And did you select "Java source" check box on the "Build job " window to export the .java file holding Java classes generated by the Job when designing it?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Could not find or load main class only when running in linux outside talend

Yes, Thank you! 

.Checking the Add classpath jar in exported jobs check box worked. And I did have the Java source checkbox checked before.

 

Thanks for your quick answer and the help.