function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Julio Cesar BollJulio Cesar Boll 

Build partner.jar

When I tried with the enterprise.wsdl I was able to generate the enterprise.jar using force-wsc-37.0.jar, js-1.7R2.jar and ST-4.0.8.jar.
Now I'm trying to generate the partner.jar but I'm getting this error:
Error: Not possible to find neither load the main class com.salesforce.ws.tools.wsdlc
I used the same command line to Enterprise and Partner. ($ java -classpath force-wsc-37.0.jar:js-1.7R2.jar:ST-4.0.8.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar)
Best Answer chosen by Julio Cesar Boll
Hans LissHans Liss
I'm a bit confused over your command line. I did find some references from back in 2013 regarding js-1.7R2.jar and ST-4.0.8.jar, but when I followed the instructions on the page you linked, and the README.md file in the cloned git repository, those jars aren't mentioned at all. In fact, I tried following step 3 and 4 on the page you linked, and it worked just fine. For the details about building and running the tools, I followed the instructions in the README.md file. Thus:
$ git clone https://github.com/forcedotcom/wsc.git
.
.
.
$ mvn clean package
.
.
.
$ java -classpath target/force-wsc-38.0.0-uber.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 632 java files.
[WSC][wsdlc.main:71]Compiling to target 1.6... 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
[WSC][wsdlc.main:71]Compiled 636 java files.
[WSC][wsdlc.main:71]Generating jar file ... enterprise.jar
[WSC][wsdlc.main:71]Generated jar file enterprise.jar
$ $ java -classpath target/force-wsc-37.0.1-uber.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar
Error: Could not find or load main class com.sforce.ws.tools.wsdlc
hansli@hanslipc:~/tmp/wsdlc/wsc$ java -classpath target/force-wsc-38.0.0-uber.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 638 java files.
[WSC][wsdlc.main:71]Compiling to target 1.6... 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
[WSC][wsdlc.main:71]Compiled 648 java files.
[WSC][wsdlc.main:71]Generating jar file ... partner.jar
[WSC][wsdlc.main:71]Generated jar file partner.jar
So it worked according to instructions, without the extra jars. This was with wsc version 38, mind. I couldn't generate partner.jar with version 37 due some other unrelated error.

All Answers

Hans LissHans Liss
In your command line, it looks like you typed "com.sforce.ws.tools.wsdlc", not "com.salesforce.ws.tools.wsdlc". Are you absolutely sure you used the exact same command line when you tried to run it?
Julio Cesar BollJulio Cesar Boll
Hans LissHans Liss
I'm a bit confused over your command line. I did find some references from back in 2013 regarding js-1.7R2.jar and ST-4.0.8.jar, but when I followed the instructions on the page you linked, and the README.md file in the cloned git repository, those jars aren't mentioned at all. In fact, I tried following step 3 and 4 on the page you linked, and it worked just fine. For the details about building and running the tools, I followed the instructions in the README.md file. Thus:
$ git clone https://github.com/forcedotcom/wsc.git
.
.
.
$ mvn clean package
.
.
.
$ java -classpath target/force-wsc-38.0.0-uber.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 632 java files.
[WSC][wsdlc.main:71]Compiling to target 1.6... 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
[WSC][wsdlc.main:71]Compiled 636 java files.
[WSC][wsdlc.main:71]Generating jar file ... enterprise.jar
[WSC][wsdlc.main:71]Generated jar file enterprise.jar
$ $ java -classpath target/force-wsc-37.0.1-uber.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar
Error: Could not find or load main class com.sforce.ws.tools.wsdlc
hansli@hanslipc:~/tmp/wsdlc/wsc$ java -classpath target/force-wsc-38.0.0-uber.jar com.sforce.ws.tools.wsdlc partner.wsdl partner.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 638 java files.
[WSC][wsdlc.main:71]Compiling to target 1.6... 
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
[WSC][wsdlc.main:71]Compiled 648 java files.
[WSC][wsdlc.main:71]Generating jar file ... partner.jar
[WSC][wsdlc.main:71]Generated jar file partner.jar
So it worked according to instructions, without the extra jars. This was with wsc version 38, mind. I couldn't generate partner.jar with version 37 due some other unrelated error.
This was selected as the best answer
Hans LissHans Liss
Sorry, I missed a "cd wsc" command in there, after the "git" command.
Julio Cesar BollJulio Cesar Boll
Yeah, you are using the "enterprise.wsdl" and for this one I was able to generate the "enterprise.jar". But as my question mention, I'm with issues when I try to generate the "partner.jar"
 
Hans LissHans Liss
The commands I posted include both the command for enterprise.jar and the one from partner.jar.
By the way, that error you received is actually the error you get if the jars are unavailable, like if you have moved to a different directory. Java won't tell you anything helpful like "The following jars in the classpath were not found:" or anything like that. :)
Hans LissHans Liss
I wish I could edit a previous post somehow. Please disregard line 18 and 19 in that code block. :)
Julio Cesar BollJulio Cesar Boll

Thanks Hans, I found my problem...

My Maven was in 2.2.1 Version, I updated it to 3.3.9 and worked fine. Thanks for helping.

Hans LissHans Liss
Glad to hear it!