简体   繁体   English

从命令行使用Eclipse ant插件?

[英]Using Eclipse ant plugin from command line?

I know this is not a smart question. 我知道这不是一个聪明的问题。

I need to use ant from command line and there is Ant plugin in Eclipse, so I have tried to specify ANT_HOME in Eclipse to be set to the directory of that plugin. 我需要在命令行中使用ant,并且Eclipse中有Ant插件,所以我尝试在Eclipse中指定ANT_HOME设置为该插件的目录。

C:\Users\Nikolay>ant
'ant' is not recognized as an internal or external command, operable program or batch file.

Should I install a separate Ant from Apache to enable Ant from command line? 我应该从Apache安装单独的Ant以从命令行启用Ant吗?

Probably the best solution is to install ant, but you can use the binaries that are from Eclipse too. 可能最好的解决方案是安装ant,但您也可以使用来自Eclipse的二进制文件。 You will find the binaries under eclipse\\plugins\\org.apache.ant_1.8.2.v20120109-1030 . 您将在eclipse\\plugins\\org.apache.ant_1.8.2.v20120109-1030下找到二进制文件。 Note that the plugin the version may be different on your machine. 请注意,插件的版本可能与您的计算机上的版本不同。 Something like: 就像是:

${eclipse_location}\\plugins\\org.apache.ant_1.8.2.v20120109-1030\\bin\\ant

should work. 应该管用。 But this should be used only for solving something quick, until you can install ant. 但是这应该只用于快速解决问题,直到你可以安装ant。 Since you will upgrade your Eclipse/plugins and the paths will change and you will need to keep updating your environment variables this way. 由于您将升级Eclipse /插件并且路径将发生变化,您将需要以这种方式不断更新环境变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM