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
Daniel ThomsonDaniel Thomson 

unable to generate jar file from wsdl file

I am having the enterprise.wsdl file and i am trying to create a jar file using command 


java -classpath wsc-20.jar enterprise.wsdl enterprise.jar


but getting an error "Error: Unable to find compiler. Make sure that tools.jar is in your classpath:

java.lang.ClassNotFoundException: com/sun/tools/javac/Main.class"


can anyone help me..............


thank you.......................


Do you have the JRE or the JDK installed on the machine that you are attempting this on?  As far as I recall, the JRE doesn't come with the compiler, is simply a runtime environment.

Daniel ThomsonDaniel Thomson

I have installed the jdk and all the java programms well functioning...........

i have created the jar file using jar commad of java..............

it gives me error at the time of jar file creation from wdlc file even though i am having tools.jar file in my library............


As the error message suggests adding tools.jar to the classpath (i.e. the -classpath parameter), have you tried that?




I'm getting as well the same error generating the .jar file as described above. I already placed Java (JDK) in my PATH, and also tried the -classpath parameter.


Do you have any hint on this?



Rahul JhaRahul Jha

Actually its not the problem of JDK.. Its just mistake of path provided by us.........
put all the files like  - your wsdl file, wsc-20.jar and tools.jar [from Jdk lib folder] into E directory of your computer then run the below command on your command prompt.........
"java -cp E:\tools.jar;E:\wsc-20.jar enterprise.wsdl enterprise.jar"


Hi Rahul Jah,


Thanks for the info, It worked out :)






From Where you got that Tools .jar file ?

Can you provide the location ....


I am facing the same problem


I tried to follow all the instructions and I am still not able to generate the enterprise.jar file

1. I moved my force-wsc-29.0.0.jar, tools.jar, and enterprise.wsdl into c:\temp. 

2. I am using jdk 1.7.0_21 and have added the bin folder to my path. 

3. I ran this command from c:\temp: c:\temp>java -cp  force-wsc-29.0.0.jar;tools.jar enterprise.wsdl enterprise.jar


4.  I get this error:



Exception in thread "main" java.lang.NoClassDefFoundError: org/stringtemplate/v4
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.getMainMethod(
        at sun.launcher.LauncherHelper.checkAndLoadMain(


Caused by: java.lang.ClassNotFoundException: org.stringtemplate.v4.STGroupDir
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(




Ankur SinghAnkur Singh

Actually when you create a WSDL file and save it as enterprise.wsdl in will be saved as enterprise.wsdl.xml

Put that file at a location as same location for wsc-22 (or whatever you using jar version of wsc)...then give this command on cmd
java -classpath c:\wsc-23.jar C:\enterprise.wsdl.xml C:\enterprise.jar

I hope this will help you.


kanhu daskanhu das

has to be included in classpath for SOAP 36.1.1
sujay Paulsujay Paul
I had faced the same problem.After that I added tow more jar files i.e.
and it has worked.
The final command is:
D:\wsdl>java -classpath tools.jar;ST4-4.0.8.jar;force-wsc-37.0.3.jar;antlr-runtime-3.5.2.jar enterprise.wsdl enterprise.jar
Kevin Williams 35Kevin Williams 35
Found this great article: .

The Salesforce documentation is out of date as it doesn't include needing to download these additional jars.
sujay Paulsujay Paul
Actually in each 3 month they are creating a new version but all documents are not updating accordingly. So the user are affecting.

I have the same problem, and I follow the step of Sujay Paul and work.

Only Thing I have to do is, copy the tools.jar from jdk/lib and paste in the same place the others jars, and it work.

So the path is: 
java -classpath C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\force-wsc-39.0.0.jar;C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\ST-4.0.8.jar;C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\rhino-;C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\antlr-runtime-3.2.jar;C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\tools.jar C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\metadata.wsdl.xml C:\Users\rafael.santos\workspace\Metadata_Salesforce\WebContent\WEB-INF\lib\metadata.jar

If someone have the same problem than I, maybe this will help

java -classpath force-wsc-29.0.0.jar;js.jar;ST-4.0.8.jar;tools.jar   enterprise.wsdl   enterprise_stub.jar
This will work.Just put all the files mentioned here in the same folder
udaykumar kudaykumar k
hi ram, C:\Users\Uday19>java -classpath .\bulkload\tools.jar;.\bulkload\ST-4.0.8.jar;.\bulkload\force-wsc-40.0.0.jar .\bulkload\partner.wsdl .\bulkload\partner.jar
[WSC][wsdlc.main:71]Generating Java files from schema ...
[WSC][wsdlc.main:71]Generated 660 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 670 java files.
[WSC][wsdlc.main:71]Generating jar file ... .\bulkload\partner.jar
[WSC][wsdlc.main:71]Generated jar file .\bulkload\partner.jar
facing above error
Douglas MolinaDouglas Molina

I was facing this same problem, and I solved it doing the folowing steps (using Windows 7 x64):

1) Download and istall the Jdk V7u79 X64:
User-added image

2) Set some Environment Variables, in the SYSTEM VARIABLES section (NOT the User Variables) (Change the path to match with your local installations, if necessary):
C:\Program Files\Java\jdk1.7.0_79



3) Download the WSDL file in your Org, and after downloading, look at the API version:
User-added image

4) Download the necessary Jars files...
 - wsc-40.0.0.jar
   Note: You'll download the exact same wsd-xx.xx.jar version, that you see in your WSDL API file, in this case 40.0.
 - js.jar (Rhino
   Note: after download, I just unzip it, and used only the js.jar file.. and it worked.
 - ST-4.0.8.jar (String Template):

5) After download, put all this Jars and WSDL files together, in a same directory:
In my case, the WSDL was named "wsdl.jsp.xml", and the working dir was "C:\temp"
User-added image

6) Open the Windows prompt CMD and:
 - Open the working dir: cd C:\temp
 - Generate the final output Jar file, with the command line:

   java -classpath js.jar;ST-4.0.8.jar;wsc-40.0.0.jar wsdl.jsp.xml enterprise.jar
The enterprise.jar file will be generted in that same folder.
User-added image

To test if it is working, I added all this Jars as External Jars in a Eclipse project (I really dont know if all of them are required to work..), and did the same login test class from this article:

The result:
User-added image

I hope it can help in some way.
@Douglas Molina

Great answer. It contains all the tasks that one needs to do in order to create the jar files. According to me, this is the best answer.
Jana MadamJana Madam
Can we generate the jackson objects or jaxb object instead of soap objects?
Johann AbrahamJohann Abraham
Just tried the answer from @Douglas Molina with version 42.0.0 and on a Mac, it wasn't working because there was a missing jar file (antlr-runtime),  For me the following command worked (note that the classpath seperator on linux/OSX is a colon, for Windows just replace the ':' with ';'):
java -classpath rhino-1.7R4.jar:antlr-runtime-3.5.2.jar:ST4-4.0.8.jar:force-wsc-42.0.0.jar salesforce-wsdl.xml enterprise.jar

I downloaded all the Jar files using Maven:




add all the files to one folder and run this command
java -classpath force-wsc-29.0.0.jar;js.jar;ST-4.0.8.jar;tools.jar   enterprise.wsdl   enterprise_stub.jar
Antony FerminusAntony Ferminus
Hello experts,
i am using the same command with all the information above.
my wsdl is v42.
java -classpath rhino-1.7.8.jar;antlr-runtime-3.5.2.jar;ST4-4.0.8.jar;force-wsc-42.0.0.jar enterprise.wsdl enterprise.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/stringtemplate/v4/STGroupDir
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.privateGetMethodRecursive(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.validateMainClass(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.stringtemplate.v4.STGroupDir
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 7 more

can sombody help with this?
Thanks in advance.

Antony FerminusAntony Ferminus
Hi Experts,
I last i made it with the code below.
I know may be some of the jar files can be omitted but
C:\tmp>java -cp antlr-runtime-3.5.2.jar;ST4-4.0.8.jar;force-wsc-42.0.0.jar;js-1.7R2.jar;stringtemplate-4.0.jar enterprise.wsdl enterprise.jar
Harikesh ThakareHarikesh Thakare
Hi Guys,

Getting the follwing error

Error: Unable to find compiler. Make sure that tools.jar is in your classpath: java.lang.ClassNotFoundException:

after running the command

java -classpath js.jar;ST-4.0.8.jar;force-wsc-44.0.0.jar;tools.jar Enterprise.wsdl enterprise.jar

can someone help

HiCan u pls check  the steps I have shared earlier.Could be wsc  version.need to check  Sent from Yahoo Mail on Android
Antony FerminusAntony Ferminus
Put all the files in a same folder c:/temp and run the command prompt
C:\tmp>java -cp antlr-runtime-3.5.2.jar;ST4-4.0.8.jar;force-wsc-42.0.0.jar;js-1.7R2.jar;stringtemplate-4.0.jar enterprise.wsdl enterprise.jar

Enterprise JAR
It will work.
Installed latest jdk and used the below command as below and it worked..
java -cp antlr-runtime-3.5.2.jar;ST-4.1.jar;wsc.jar;js-1.7R1.jar;stringtemplate-3.2.1.jar partnerwsdl.wsdl partner.jar
Deepanshu Singh 4Deepanshu Singh 4
@Douglas Molina @Antony Ferminus
I did all the steps as mentioned by you , still getting the error...
command I am using is : java -classpath force-wsc-48.0.0.jar;rhino-1.7.12.jar;ST-4.3.jar;tools.jar wsdl.xml enterprise.jar
See the Screenshot

User-added image
Custom CallCustom Call

Hello, Can someone help me with this? 


java -classpath tools.jar;force-wsc-54.0.0.jar;ST-4.3.1.jar;rhino-1.7.14.jar;antlr-runtime-3.5.2.jar partner.wsdl sf-partner.jar


[WSC][wsdlc.main:72]Generating Java files from schema ...
[WSC][wsdlc.main:72]Generated 701 java files.
Exception in thread "main" java.lang.NullPointerException
Custom CallCustom Call

Solved this.
PATH variable was pointing to Oracle\Java\javapath causing Line 48 of from ToolProvider.getSystemJavaCompiler() to return null.
Removed that and added Java path C:\Program Files\Java\jdk1.8.0_181\bin solved it. 
partner.jar created successfully.