forcedotcom / wsc

Other
269 stars 223 forks source link

Unable to initialize main class #301

Closed suneelsfdc closed 2 years ago

suneelsfdc commented 2 years ago

I am trying to generate Stub Files from WSDLs by following this link - https://developer.salesforce.com/docs/atlas.en-us.salesforce_developer_environment_tipsheet.meta/salesforce_developer_environment_tipsheet/salesforce_developer_environment_wsc.htm and https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_import_WSDLs.htm

Ran below two commands following both of the documentation. But getting same error - Error: Unable to initialize main class com.sforce.ws.tools.wsdlc Caused by: java.lang.NoClassDefFoundError: org/stringtemplate/v4/STGroupDir

Command 1: java -jar force-wsc-55.2.0.jar /Users/user123/Downloads/WSC_files/metadata.wsdl.xml metadata.jar

Command 2: java -classpath /Users/user123/Downloads/WSC_files/force-wsc-55.2.0.jar:/Users/user123/Downloads/WSC_files com.sforce.ws.tools.wsdlc /Users/user123/Downloads/WSC_files/metadata.wsdl.xml ./metadata.jar

suneelsfdc commented 2 years ago

Never mind. It worked after pointing the classpath to location of Jar files folder and running the following command java -cp force-wsc-55.2.0.jar:ST4-4.3.3.jar:antlr-runtime-3.5.jar com.sforce.ws.tools.wsdlc metadata.xml metadata.jar