0

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.

2
  • 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
    Commented Jun 10, 2016 at 11:03
  • You need to put the absolute path - not the relative path for all files references. Commented May 21, 2020 at 0:42

1 Answer 1

2

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

1
  • Well done! works like a charm!
    – Uri Lukach
    Commented Jun 23, 2016 at 7:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .