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.