Six Stars

Could not find or load main class

 

I have  already tried the solutions recommended by other posts on the community:

- install path with no spaces

- running on java 1.8_77

- cleaned up work space

- fresh install of talend

 

None of the above have resolved my issue. I am running talend on my local machine

 

i am running talend studio for big data 6.3.0

with 

java jdk is 1.8_77

 

talend path is  

/Users/me/Documents/Software/TOS_BD-20161026_1219-V6.3.0/TOS_BD-macosx-cocoa

 

can some one help as i have exhausted all possible solutions.

let me know if any other information can be provided

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: Could not find or load main class

Solution FOUND !!

 

It seems i have added and extra java library in the extensions folder where the java install path is. somehow this effected talend although im not sure why. i have now removed this extra library and it works again.

 

 

32 REPLIES
Moderator

Re: Could not find or load main class

Hi,

What's your OS? Does this issue repro on all jobs or a specific job on big data 6.3.0? Does this issue repro on other build version? V 6.4? Is your java environment set correctly?

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.
Six Stars

Re: Could not find or load main class

im running on mac os seirra 64 bit. 

the issue if affecting all jobs, i cannot even just run a blank talend job.

 

i have set my paths as follows 

JDK:   

export JAVA_HOME=/Library/Java/JavaVirtualMachines/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home

 

and in talend studio my JRE library points to :

/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home

 

currently i am only using talend studio big data V6.3 and had no issue till today, even earlier my setup was working fine, but suddenly stopped working.

Moderator

Re: Could not find or load main class

Hi,

Is there any more error message in log? Which is located in <Talend Studio installation path>/workspace/.metadata/.log

Is it a random issue?

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.
Six Stars

Re: Could not find or load main class

I cant find the /.metadata/.log path in the workspace folder?
Six Stars

Re: Could not find or load main class

this is my folder set up

Moderator

Re: Could not find or load main class

Hello,

Is there any log under your configuration folder?

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.
Six Stars

Re: Could not find or load main class

no nothing under there either. is it created by default or do i have to set up in Talend studio preferences to make a log location??

Moderator

Re: Could not find or load main class

Hi,

Can you start up your studio successfully  without error? Does this issue only repro when build a job? Could you please go to “Window > Show view > General > Error Log” to see if there is any error message?

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.
Six Stars

Re: Could not find or load main class

i am running in just the studio which indeed does start up without any errors . I am just running it in studio not building it.

 

these are the following log error i get :

 

eclipse.buildId=unknown
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_GB
Framework arguments: -keyring /Users/joeldasari/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/joeldasari/.eclipse_keyring -showlocation

org.talend.platform.logging
Info
Wed Aug 09 10:56:07 BST 2017
2017-08-09 10:56:07,201 INFO org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory - Using NULL lifecycle mapping for MavenProject: org.talend.master.local:code.Master:6.3.0 @ /Users/joeldasari/Documents/Software/TOS_BD-20161026_1219-V6.3.0/workspace/.Java/pom.xml.
-----------------------------


eclipse.buildId=unknown
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_GB
Framework arguments: -keyring /Users/joeldasari/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/joeldasari/.eclipse_keyring -showlocation

org.talend.platform.logging
Info
Wed Aug 09 10:56:06 BST 2017
2017-08-09 10:56:06,657 INFO org.talend.designer.core.runprocess.Processor - Command line: java -Xms256M -Xmx1024M -Dfile.encoding=UTF-8 -cp /Users/joeldasari/Documents/Software/TOS_BD-20161026_1219-V6.3.0/workspace/.Java/target/classes:.:/Users/joeldasari/Documents/Software/TOS_BD-20161026_1219-V6.3.0/workspace/.Java/lib/dom4j-1.6.1.jar:/Users/joeldasari/Documents/Software/TOS_BD-20161026_1219-V6.3.0/workspace/.Java/lib/log4j-1.2.16.jar: local.test_0_1.test --context=Default --stat_port=3585
-----------------------------


eclipse.buildId=unknown
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_GB
Framework arguments: -keyring /Users/joeldasari/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -keyring /Users/joeldasari/.eclipse_keyring -showlocation

org.talend.platform.logging
Info
Wed Aug 09 10:56:06 BST 2017
2017-08-09 10:56:06,240 INFO org.eclipse.m2e.core.internal.lifecyclemapping.LifecycleMappingFactory - Using NULL lifecycle mapping for MavenProject: org.talend.master.local:code.Master:6.3.0 @ /Users/joeldasari/Documents/Software/TOS_BD-20161026_1219-V6.3.0/workspace/.Java/pom.xml.

Six Stars

Re: Could not find or load main class

Solution FOUND !!

 

It seems i have added and extra java library in the extensions folder where the java install path is. somehow this effected talend although im not sure why. i have now removed this extra library and it works again.

 

 

Six Stars

Re: Could not find or load main class

just to add to the solution, Any extra error or hints can be found by changing from integration mode (top right icon ), into java mode by clicking on the little icon at the top to change modes

Moderator

Re: Could not find or load main class

Hello,

Great this issue has been fixed. Thanks for posting your issue here.

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

You could use java 9 by adding the line 

--add-modules=ALL-SYSTEM 

to TOS_DI-20170623_1246-V6.4.1\plugins\org.talend.rcp_6.4.1.20170623_1246\eclipse.ini

-vmargs
--add-modules=ALL-SYSTEM

 

and to TOS_DI-win-x86_64.ini

-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM

 

Four Stars EM
Four Stars

Re: Could not find or load main class

please, can you tell me in detail  how to solve this  error?!!! 

where is extensions folder? which libraries i need to remove ??

thanks

Five Stars

Re: Could not find or load main class

Hi All,

I have an issue "could not find or load the main class" when I run the job from ide, I have instructed to check java installation path and environment setup everything, I have no idea to resolve this,

I have checked my installation path, there are no blank spaces,

this is the below environment setup,

JAVA_HOME - C:\Program Files\Java\jdk1.8.0_162\

JRE_HOME- C:\Program Files\Java\jre1.8.0_162\

TALEND_HOME -C:/Talend/6.4.1

path - C:\Program Files\Java\jdk1.8.0_162\bin   

operating system - Windows 8.1 or Windows Server 2012 R2 

can you have an alternative way to resolve this?

Five Stars

Re: Could not find or load main class

Hi please mention that extensions folder where the java installation path.

Moderator

Re: Could not find or load main class

Hello,

Could you ensure JDK bin is included in your PATH environment variable and is being reached?

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.
Five Stars

Re: Could not find or load main class

I have included JDK bin path to PATH variable also but it's not working.  Still, maintain the error "
Error: Could not find or load main class
" . is there any alternate way to resolving this?

Moderator

Re: Could not find or load main class

Hello,

Does this error "Error: Could not find or load main class" repro on all your jobs or a specific one?

We cannot repro this issue on our side. Could you please give us more information about your currrent situation? Which will be helpful for us to address your issue.

Thanks for your time.

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.
Five Stars

Re: Could not find or load main class

Hi,

My all the jobs have this error, not a  specific one job. i had mentioned my all details in previous msg or replies

Five Stars

Re: Could not find or load main class

Hi,

 

When I try to run even print statement it gives an error "could not find or load the main class". please let me know what information i should give more ?

 

Thanks,

Mani

Moderator

Re: Could not find or load main class

Hello,

Are you using Oracle JDK 1.8 or OpenJDK? So far, we cannot repro this issue on window10, talend v 6.4.

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.
Five Stars

Re: Could not find or load main class

Hello,

 

am using oracle jdk, below is our java -version details,

C:\Users\mani>java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

 

Thanks,

mani

Moderator

Re: Could not find or load main class

Hello,

Does this issue repro on other build version? V 6.5 or V 7.0? Could you please post your installation path here?

Note: No blank space or special characters in the installation path or the workspace path

I upload my java environment setting screenshot, hope it will help.

1.png

 

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

I had the same problem  with talend 7.0.1. In my case, there was a problem with tRunJob and mostly helped uncheck "Use specific JVM arguments" in SubJob.

TOS_Specific_JVM.png

 

 

Final solution was: Project Settings -> Job Settings -> Use Project Settings and check all jobs.  After this setting everything works correctly. And, surprisingly, you can set the specific JVM back and it's OK.

TOS_Project_Settings.png

 

Tested on Windows 10 and Windows Server 2016. Java version "1.8.0_171" installed by classic next next (all in default)
Sorry for my English

 

Best Regards
Martin

Five Stars

Re: Could not find or load main class

Hi,

 Below I shared my environment setup path, please take a look at with it,

 

environment_path.JPGenvi_path.JPG

Five Stars

Re: Could not find or load main class

Hello MartinG,

I had tried your idea, but in my case its not worked, facing again could not find or load the main class
Five Stars

Re: Could not find or load main class

HI,
My talend version is 6.4.1 FYI
Moderator

Re: Could not find or load main class

Hello,

From your screenshot, we don't find any issue in your Java environment setting. What can you get when do java -version in cmd?

Have you tried to go to Window > Preferences >Java--> Installed JREs, selecting Edit and browsing for the appropriate JRE? Is your workspace corrupt?

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.