I want to compile the partner API code from the WSDL using the WSC compile tool.

After running

java -classpath wsc-22.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar

I get the error:

Error could not find or load main class com.sforce.ws.tools.wsdlc

Any help/suggestion is appreciated.

  • Most likely cause is that you do not have the JAR file wsc-22.jar in the folder that you are running the java command in. Copy the JAR to that folder or specify the full path of the JAR file. The com.sforce.ws.tools.wsdlc is in that JAR. – Keith C Jun 10 '16 at 11:03

After adding JDK executables to path it is working fine.

On Windows, click Start > Control Panel > System and Security > System > Advanced system settings. Click Environment Variables and find the PATH variable in System variables. Add the location of the bin folder of the JDK installation path to the end of your path value. Your path might look something like: %SystemRoot%\system32;%SystemRoot%;C:\Program Files\Java\jdk1.7.0_15\bin. Click Ok to apply the changes.

Once path is set, run below mentioned command to generate partner wsdl jar file-

java -classpath D:\SFDC\WSC\force-wsc-37.0.3.jar;D:\SFDC\WSC\ST4-4.0.8.jar;D:\SFDC\WSC\antlr-runtime-3.5.2.jar com.sforce.ws.tools.wsdlc D:\SFDC_videos\WSC\WSDL\partner.wsdl .\partner.jar

  • Well done! works like a charm! – Uri Lukach Jun 23 '16 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.