Generating Java classes from wsdl error



I'm trying to generate Java classes from a wsdl within the Java EE:Webservice plugin but I get the following error message:

/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java -Xmx128M -p mypackage -d /Users/mgr/IdeaProjects/wstest/src -s /Users/mgr/IdeaProjects/wstest/src -wsdllocation file:/Users/mgr/IdeaProjects/wstest/src/mypackage/dlws.wsdl file:/Users/mgr/IdeaProjects/wstest/src/mypackage/dlws.wsdl
Error: Could not find or load main class


I can however generate the classes if i run the following command line tool:

wsimport -extension dlws.wsdl



I'm using

IntelliJ IDEA 2016.3.2
Build #IU-163.10154.41, built on December 21, 2016
Licensed to TradeChannel AB / Mikael Grevsten
You have perpetual fallback license for this version
Subscription is active until December 11, 2017
JRE: 1.8.0_112-release-408-b6 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o


MacBook /w Sierra 10.12.2


Pls advice




Edit the JSDK configuration in IntelliJ IDEA and add tools.jar to 1.8 JDK classpath.


Hi, thanks


It's is there already


Try a more recent Java version from Oracle.


Tried 112 but same result


As far as I can see the WSImport is in the package


You are right, it appears that you need in the classpath. is in\jaxws-ri\lib\jaxws-tools.jar.


Hmm, this didn't work either…



Even when added to JDK classpath?


If this is the right place to put it:


Ok, it appears the classpath has no effect for wsimport.

Please file a bug at with a small sample project and the exact steps to reproduce.


So, as per my findings, this is a classpath issue. I faced this issue with jdk 11 on a windows 10 machine. The classpath was the regular ".../jdk-11.0.1/" for me. But I realized that tools.jar was at "C:\Program Files\Java\jdk-11.0.1\lib\src\jdk.jartool\sun\tools.jar". The program run specified WsImport to be searched at "" which was obviously the wrong place to search. I solved the issue by reverting back to jdk 8 (since I needed a quick solution).


i have the same problem using jdk 17.


Error: Could not find or load main class intellij

I try to generate a client from a wsdl

i need help



Aristides Figueroa What IDE version do you use? This issue is fixed in 2021.3.1 version.

If it still doesn't work for you in the current IDE release, please contact support at and attach a sample project to reproduce the problem.


Hi Serge

IntelliJ IDEA 2022.2.3 (Ultimate Edition)
Build #IU-222.4345.14, built on October 4, 2022
Runtime version: x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.7.4
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Non-Bundled Plugins:
    org.xiaogang.unit.test (
    com.mirkoalicastro.mavenversionrefactor (1.0.5)
    org.jetbrains.kotlin (222-1.8.10-release-430-IJ4167.29) (222.4345.14)

Kotlin: 222-1.8.10-release-430-IJ4167.29


Aristides Figueroa Make sure your project dependencies include jaxws-ri library.


Serge Baranov

I have included the dependency. later in the module in tools selections generate java code from Wdls and I have the same result



Serge Baranov

my test project is pretty simple. I follow the documentation to generate a web service client. (

Generate Java Code from WSDL

The test wdsl is:



Aristides Figueroa You also need this dependency:


Serge Baranov

friend thanks for the support

I have also added that dependency and I get the same result

I did it in Netbeans with no problem in less than 5 minutes.

And then always in Netbeans I also applied it to other private web services that I needed to test.

Itelleji is one of my favourites, but I lost a day trying to generate java code from a wsdl without success.

maybe you can generate it from this wsdl


Please sign in to leave a comment.