问题
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.
回答1:
C:\Program Files\Java\jdk1.7.0_60\bin
This is where my jdk is, works for my system:
- Go to My computer >> right click and select properties.
- On the properties tab select Advanced system settings (Windows 7)
- Click enviroment variables
- select path and click edit option
- add
";C:\Program Files\Java\jdk1.7.0_60\bin"
at the end. - Done.
回答2:
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"
回答3:
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.
回答4:
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!
回答5:
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!!!
回答6:
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.
回答7:
If you're on linux and can't find wsimport as a default shell command, you might want to install openjdk-devel.
回答8:
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..
回答9:
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
回答10:
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.
来源:https://stackoverflow.com/questions/20920693/wsimport-is-not-recognized-error-in-command-prompt