" java.exe的"不被识别为一个内部或外部命令,可操作的程序或批处理文件 [英] "java.exe" is not recognized as an internal or external command, operable program or batch file

查看:406
本文介绍了" java.exe的"不被识别为一个内部或外部命令,可操作的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写在C#中使用Process对象通过与CMD.EXE蚂蚁批处理文件创建一个Java portlet中的应用程序。

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#.

当我通过创建命令创建的portlet的CMD,我收到一个错误是这样的:

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.

但是,当我键入直接在CMD命令,即正常工作。

But when I type this command on the cmd directly, that works correctly.

我已经安装了JDK在我的Windows 7,并设置JAVA_HOME和ANT_HOME变量的环境变量。你能帮助我纠正?

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?

推荐答案

您应该检查PATH变量。您可以使用命令正确的路径设置为您的Java环境的文件夹。

You should check your PATH variable. You can use the set command to set the correct path to your java environment folder.

这篇关于" java.exe的"不被识别为一个内部或外部命令,可操作的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆