在Windows 7中为Java和ant设置环境变量 [英] setting up environment variables in windows 7 for java and ant

查看:89
本文介绍了在Windows 7中为Java和ant设置环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一本书说要做以下事情.

I have a book that says to do the following.

  1. 添加JAVA_HOME和ANT_HOME环境变量. -检查
  2. 将$ JAVA_HOME/bin和$ ANT_HOME/bin添加到我的路径变量-检查

然后我进入命令提示符并尝试使用ant -version时,它说ant是无法识别的命令.然后,如果我使用该值,则将其插入ANT_HOME变量并使用它代替$ ANT_HOME,则一切正常.这是应该在Windows中工作的方式吗?我不确定,所以我只是想出了放在ANT_HOME中的任何内容然后在用作$ ANT_HOME时会在path变量中进行解析.谢谢.

When I then go to the command prompt and try ant -version it says ant is not a recognized command. If I then take the value I plugged into the ANT_HOME variable and use it in place of $ANT_HOME it all works. Is this the way it's supposed to work in windows? I'm not sure so I just figured that whatever was put in ANT_HOME was then parsed in the path variable when used as $ANT_HOME. Thanks.

推荐答案

您可以尝试以下操作:

SET ANT_HOME=my_path_to_ant_folder
SET JAVA_HOME=my_path_to_jdk_folder
SET PATH=%PATH%;%ANT_HOME%/bin;%JAVA_HOME%\bin;

这篇关于在Windows 7中为Java和ant设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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