How can I run ANT from a batch file without having an Environment Variable set?
Asked Answered
P

1

2

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.

I have a build.bat file which starts with :

ant blah/blah/blah

But what if I want to run ANT directly without the system environment variable? If I remove these from the system ant is not recognised.

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.

Palatinate answered 14/2, 2012 at 21:12 Comment(0)
P
3

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
Pantomimist answered 14/2, 2012 at 21:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.