简体   繁体   中英

Unable to run wsimport utility in JDK8

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM