I am writing an application that creates a Java portlet by the ant batch file with the cmd.exe using a Process object in C#.
When I pass the "Create" command to the cmd to create portlet, I receive an error like this:
'"java.exe"' is not recognized as an internal or external command,
operable program or batch file.
But when I type this command on the cmd directly, that works correctly.
I've installed the JDK on my windows 7 and set the JAVA_HOME and ANT_HOME variables in the Environment Variables. Can you help me to correct that?
解决方案
You should check your PATH variable. You can use the set command to set the correct path to your java environment folder.
在Windows 7上使用C#通过cmd.exe和ANT创建Java portlet时遇到错误:'java.exe' 不被识别为内部或外部命令。已安装JDK并设置了JAVA_HOME和ANT_HOME环境变量。当直接在命令行输入命令时,操作正常。解决方法是检查PATH环境变量,确保它指向正确的Java环境目录。
3678

被折叠的 条评论
为什么被折叠?



