这个问题是针对java web服务初学者的。
如果您在构建或在网络服务中生成客户端代码时遇到问题。
因此,我建议您按照以下步骤操作:-
1) Open your eclipse, i'm sure it shall be open only :)
2) Now go to File > Properties or just say ( ALT + Enter )**
3) You shall be prompted with new window Named "Properties"
4)Here look for the Java Build Path , then check for the Installed JRE of your eclipse.
5)If path is given only JRE but not jdk, Please change it immediately
这是唯一不允许您调用 wsimport 命令的事情。
因为wsimport是一个exe文件,位于JDK/bin目录而不是JRE目录
这就是为什么你总是遇到无法执行命令的问题。
现在享受您的学习吧。
最佳答案
您可以尝试使用Apache Ant用于在 eclipse 上使用 wsimport
生成 WebService 的客户端JDK 中的工具。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="generate-client" default="generate-client" basedir=".">
<property name="java.home" value="C:\Software\Java\jdk1.7.0_05" />
<property name="wsdl.location"
value="http://www.webservicex.net/geoipservice.asmx?WSDL" />
<target name="generate-client">
<exec executable="${java.home}\bin\wsimport.exe">
<arg line="${wsdl.location} -s src -Xdebug -verbose -Xnocompile" />
</exec>
</target>
</project>
将此 XML 文件放入您的项目文件夹中。
关于java - 无法运行程序 "wsimport": CreateProcess in eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14567336/