Reputation: 1001
I am new at web-services. I am trying to generate the stubs using this command:
wsimport -d ./build -s ./src -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl -b jaxws-custom.xml
I am getting this error in the cmd:
wsimport is not recognized
My Java environment variable system path is C:\Program Files (x86)\Java\jdk1.7.0
. What am I doing wrong?
I resolved this issue by using wsimport from netbeans not from cmd...but I still don't know why I couldn't use it from cmd.
Upvotes: 12
Views: 67655
Reputation: 11110
For those who have all the environment variables configured correctly, but still wonder why wsimport
is not recognized/found:
This question is old, and the answers are not anymore relevant today, because JAX-WS tools like wsimport
and wsgen
were removed from Java SE, since Java 11, as part of JEP 320 (Remove the Java EE and CORBA Modules).
In order to use those JAX-WS tools, you can either download binaries from here or use some different plugins, like:
Upvotes: 0
Reputation: 1
I just delete the entry in path as %JAVA_HOME%\bin
and provide the direct path as C:\Program Files\Java\jdk1.8.0_101\bin
. I don't know why because previously also it was pointing to same directory only.
Upvotes: -1
Reputation: 481
This is the best solution for this problem:
run on your cmd this line:
c:>set path=%path%;C:\Program Files\Java\jdk1.8.0_51\bin
It should work.
I found it on http://www.skylit.com/javamethods/faqs/javaindos.html
Upvotes: 0
Reputation: 1
Actually the problem for this issue is system is not finding the java on the path variable. Eventually the command will work after adding the java on your system path variable..
Upvotes: 0
Reputation: 179
If you're on linux and can't find wsimport as a default shell command, you might want to install openjdk-devel.
Upvotes: 0
Reputation: 159
You can also do this instead of changing the enviroment path variables
'C:\Program Files\Java\jdk1.8.0_60\bin\wsimport.exe'
And simply execute your code like:
'C:\Program Files\Java\jdk1.8.0_60\bin\wsimport.exe' -d ./build -s ./src -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl -b jaxws-custom.xml
I know this is an old post but I found this solution today and this was the way I solved!
Upvotes: 1
Reputation: 3091
Go to the environment variable. Under system variable choose "PATH" and edit it. In the new dialog box append path till bin folder of jdk. It MUST work.
Upvotes: 0
Reputation: 276
C:\Program Files\Java\jdk1.7.0_60\bin
This is where my jdk is, works for my system:
";C:\Program Files\Java\jdk1.7.0_60\bin"
Upvotes: 26
Reputation: 11
your java path is not set properly. what you can do is. go to your java bin folder in your cmd prompt like c:\java\jdk.1.7.0\bin and enter your command like wsimport or wsimport -keep -s blahblahblah.
This will work!!!
Upvotes: 1
Reputation: 1738
I offer to create JAVA_HOME path. For example my JAVA_HOME:
JAVA_HOME c:\Java\jdk1.6.0_26\
My java path not include any special character and spacing between characters. Windows Path included this:
%JAVA_HOME%\bin;
or:
c:\Java\jdk1.6.0_26\bin;
Please check your Path. May be included wrong character, another slash, second java path or not included semicolon.
Upvotes: 2
Reputation: 68715
wsimport and all other java commands are present in jdk bin directory and hence you need to update your PATH variable to include:
"C:\Program Files (x86)\Java\jdk1.7.0\bin"
instead of
"C:\Program Files (x86)\Java\jdk1.7.0"
Upvotes: 7