Axis2在cmd处理wsdl时,找不到JAVA_HOME,The JAVA_HOME environment variable is not defined
报了这个错误:
The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program
可是执行java -version可以正确显示版本信息:
这说明JAVA_HOME是设置了的,到【我的电脑】【属性】【高级】【环境变量】中也是可以看到设置的 D:Program FilesJavajdk1.8.0_181
问题出现在哪里呢?只能打开wsdl2java.bat查看是哪里报的错:
rem Make sure prerequisite environment variables are set if not "%JAVA_HOME%" == "" goto gotJavaHome echo The JAVA_HOME environment variable is not defined echo This environment variable is needed to run this program goto end
你可能就明白了,问题出现在JAVA_HOME的设置不能到bin下,而是应该到D:Program FilesJavajdk1.8.0_181,为了不改变原来的设置,你可以在cmd窗口中重新设置:
set JAVA_HOME=D:Program FilesJavajdk1.8.0_181
这样,执行wsdl2java就可以看到提示了!