“java.exe” is not recognized as an internal or ext

2020-03-30 16:22发布

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?

标签: c# java ant cmd
7条回答
我欲成王,谁敢阻挡
2楼-- · 2020-03-30 16:49

If you have multiple values in your PATH variable, make sure they are not separated with a space following the end semi-colon (;)

查看更多
登录 后发表回答