编程语言
首页 > 编程语言> > Axis2在cmd处理wsdl时,找不到JAVA_HOME,The JAVA_HOME environment variable is not defined

Axis2在cmd处理wsdl时,找不到JAVA_HOME,The JAVA_HOME environment variable is not defined

作者:互联网

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 Files\Java\jdk1.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 Files\Java\jdk1.8.0_181,为了不改变原来的设置,你可以在cmd窗口中重新设置:


set JAVA_HOME=D:\Program Files\Java\jdk1.8.0_181


这样,执行wsdl2java就可以看到提示了!

 

标签:JAVA,Axis2,defined,environment,Java,variable,HOME
来源: https://www.cnblogs.com/achengmu/p/15432550.html