安装Ant来使用JDK不同从一个在指定JAVA_HOME [英] Setup Ant to use JDK different from one specified in JAVA_HOME
问题描述
因此,对于运行的原因很多项目,我不想改变JAVA_HOME变量(1.6),但我想蚂蚁运行和使用JDK 1.5。
So for reason of running many projects, I don't want to change JAVA_HOME variable (1.6) but I would like ant to run and use 1.5 JDK.
我必须设法从Eclipse IDE中做到这一点(因此它可以做到),因此从Eclipse IDE中运行时,因为我指定的JDK 1.5作为项目的JDK它将使用1.5。
I have manage to do this from Eclipse IDE (so it can be done), so when running from Eclipse IDE it will use 1.5 since I specified JDK 1.5 as project's JDK.
为了使长话短说我想从蚂蚁CMD提示符下运行使用JDK 1.5的时候。
To make long story short I want Ant when run from cmd prompt to use JDK 1.5.
好像pretty容易,但我无法找出做到这一点的方式。
Seems pretty easy but I am having trouble finding out the way to do it.
P.S。
我之所以需要这个从命令提示符下运行是因为Ant构建是很长3-4分钟,而它的运行我的Eclipse IDE被冻结。三分钟的等待是根本不能接受:)
Reason I need this to work from command prompt is because ant build is quite long 3-4 mins and my Eclipse IDE gets frozen while it's running. Three minutes waits are simply not acceptable :)
谢谢大家。
推荐答案
您可以编写自己的脚本,叫做ANT2或类似的,从您想要的JDK执行蚂蚁,并将其添加到PATH。
You can write your own script, called ant2 or similar, to execute ant from the JDK that you want and add it into the PATH.
这篇关于安装Ant来使用JDK不同从一个在指定JAVA_HOME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!