无法在JDK8中运行wsimport实用程序 [英] Unable to run wsimport utility in JDK8

查看:453
本文介绍了无法在JDK8中运行wsimport实用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

现在;为了使用Amazon的Product API,我遵循他们的指南此处在Java入门部分中;我使用以下命令...

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.

现在,当我运行上述命令时,该自定义目录将包含Amazon提供的说明页中指定的build和src目录。我收到错误...

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

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

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

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

不确定在哪里

请注意,我已经在此页面

推荐答案

我在以下文章的评论部分中找到了这一点。我将其全部包含在此处,因为我认为它可以解释为什么您的JDK8 / wsimport无法构建,因此当您切换回Java7时它也可以工作。

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-to-switches-to-java-8-just-yet /

即使这篇文章是3年前写的,我仍然有java8 / wsimport问题(2017年)。

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. Javadoc中的新默认值(称为doclint)将破坏您的构建。特别是如果您使用的是Maven和某种CI(例如Hudson,
    Jenkins),您会很快意识到,您不能只接受
    项目并在JDK8中进行构建。您的构建几乎肯定会出错,因为有
    的新Javadoc。 (我还没有看到一个没有的项目)。
    的原因是在Maven中,javadoc工具中的返回错误代码将使
    停止整个发行过程……正如我所说,我还没有看到
    项目不会在某个地方出现有Javadoc doclint不符合项。
    大多数较大的项目(例如Netty)似乎都可以通过简单地
    关闭doclint(当然这不是doclint的主意)来解决该问题,或者
    或在JDK7上停留更长的时间直到他们解决了所有的
    评论问题。

  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.

JDK8中的代码生成工具(例如wsimport)产生的代码与doclint不兼容。这是一个明显的错误,并且有据可查。
表示JDK8的一部分无法与JDK8的
的另一部分一起使用。如果您有网络
消费者应用程序,则期望以某种方式规避此问题。

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.


这篇关于无法在JDK8中运行wsimport实用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆