質問

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.

役に立ちましたか?

解決

C:\Program Files\Java\jdk1.7.0_60\bin

This is where my jdk is, works for my system:

  1. Go to My computer >> right click and select properties.
  2. On the properties tab select Advanced system settings (Windows 7)
  3. Click enviroment variables
  4. select path and click edit option
  5. add
    ";C:\Program Files\Java\jdk1.7.0_60\bin"
    at the end.
  6. Done.

他のヒント

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"

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.

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!!!

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!

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.

If you're on linux and can't find wsimport as a default shell command, you might want to install openjdk-devel.

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..

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

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top