我怎样才能运行批处理文件ANT,而无需一个环境变量设置? [英] How can I run ANT from a batch file without having an Environment Variable set?
本文介绍了我怎样才能运行批处理文件ANT,而无需一个环境变量设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想包括ANT的JavaSDK和FlexSDK到我的项目目录。我需要在我公司的人能够从源头code编译。
I want to include ANT, the JavaSDK and FlexSDK into my project directory. I need people in my company to be able to compile from source code.
我有同一个启动文件的build.bat:
I have a build.bat file which starts with :
ant blah/blah/blah
但是,如果我想直接在没有系统环境变量运行Ant是什么?如果我从系统中删除这些蚂蚁无法识别
。
我在这里是一个真正的新手,但我想要做这样的事情:
I am a real newbie here, but I want to do something like this:
start "${basedir}\libs\ant\bin" ant -lib ${basedir}/libs/ant/lib/flexTasks.jar
pause
这是让其他人不需要安装软件的整个负载...这将所有包含在文件夹中。
This is so that other people dont need to install a whole load of software... IT would all be contained in the folder.
推荐答案
只需设置这些环境变量在同一个批处理文件,即是这样的:结果
Just set those environment variables in the same batchfile, i.e. something like :
set ANT_HOME=C:\ant182
set ANT_ARGS=-lib C:\antxtralibs
set JAVA_HOME=C:\jdk160_30
set PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin
:: default
ant -f %1
:: debug
:: ant -debug -f %1
这篇关于我怎样才能运行批处理文件ANT,而无需一个环境变量设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文