gpt4 book ai didi

java - 无法在 JDK8 中运行 wsimport 实用程序

转载 作者:行者123 更新时间:2023-11-29 08:49:13 24 4
gpt4 key购买 nike

我在目录 C:\Program Files\Java\jdk1.8.0_05\ 中安装了 JDK8,并将我的 PATH 环境变量设置为 C :\Program Files\Java\jdk1.8.0_05\bin.

现在;为了使用亚马逊的产品 API,我遵循他们的指南 here在 Java 设置部分下;然后我使用以下命令...

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

在我在桌面上创建的自定义目录中打开命令提示符后;该自定义目录包含亚马逊提供的说明页面中指定的构建和 src 目录。

现在当我运行上述命令时;我收到错误...

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

但是;如果我在同一个命令提示符下运行 Java -version 一切正常并且符合预期。

不确定从这里去哪里或者为什么它没有通读?

请注意,我已经在 this page 尝试了解决方案;无济于事。

最佳答案

我在下一篇文章的评论部分找到了这个。我将它完整地包含在这里,因为我认为它解释了为什么你的 JDK8/wsimport 无法构建,以及为什么当你切换回 Java7 时它仍然有效。

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

尽管这篇文章是 3 年前写的,但我仍然遇到 java8/wsimport 问题(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.

关于java - 无法在 JDK8 中运行 wsimport 实用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23555188/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com