Unable to run wsimport utility in JDK8

北城余情 提交于 2019-12-11 01:26:40

问题


I have JDK8 installed in the directory C:\Program Files\Java\jdk1.8.0_05\ and I have my PATH Environment Variable set to C:\Program Files\Java\jdk1.8.0_05\bin.

Now; in order to use Amazon's Product API I follow their guidelines here under the Java getting set up section; and I use the following command...

wsimport -d ./build -s ./src  -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl -b jaxws-custom.xml

after opening a command prompt in a custom directory I created on my desktop; that custom directory contains the build and src directories as specified in the instructional page provided by Amazon.

Now when I run the command aforementioned; I receive the error...

'wsimport' is not recognized as an internal or external command

however; if I run Java -version within the same command prompt all works well and as expected.

Not sure where to go from here or why it isn't reading through?

Note I already attempted the solutions at this page; to no avail.


回答1:


I found this in the comments section of the following article. I include it here in full because I think it explains why your JDK8/wsimport fails to build and consequently why it works when you switch back to Java7.

http://blog.takipi.com/6-reasons-not-to-switch-to-java-8-just-yet/

Even though the article was written over 3 years ago, I am still having java8/wsimport problems (2017).

Why not mention some more obvious ones:

  1. The new defaults in Javadoc (called doclint) will break your build. In particular if you are using Maven and some kind of CI (e.g. Hudson, Jenkins) you'll quickly realize that you can't just take your project and build in JDK8. Your build will almost certainly error out because of the new Javadoc. (I have yet to see a project that didn't). The reason is that in Maven a return error code from the javadoc tool will stop the whole release process ... and as I said I have yet to see a project that would not somewhere have a Javadoc doclint noncompliance. Most larger projects (e.g. Netty) seem to solve the problem by simply turning off doclint (which of course wasn't the idea behind doclint) or they stay on JDK7 for a while longer until they iron out all their comments problems.

  2. Code generation tools in JDK8 (e.g. wsimport) produce code that is not doclint compliant. This is a clear bug and well documented. It means that one part of the JDK8 is not working with another part of the JDK8. Expect to have to circumvent this somehow if you have a web consumer application.



来源:https://stackoverflow.com/questions/23555188/unable-to-run-wsimport-utility-in-jdk8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!