[英]How to set JAVA HOME in Ant build.xml
I have the following build.xml file and i want to set JAVA HOME path but i don't know where to write and what to write. 我有以下build.xml文件,我想设置JAVA HOME路径,但是我不知道在哪里写和写什么。 Does anyone wants to help me? 有人想帮助我吗?
<target name="clean">
<delete dir="build"/>
</target>
<target name="compile">
<mkdir dir="build/classes"/>
<javac srcdir="src" destdir="build/classes"/>
</target>
<target name="jar">
<mkdir dir="build/jar"/>
<jar destfile="mapreduce.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="Master"/>
</manifest>
</jar>
</target>
<target name="run">
<java jar="mapreduce.jar" fork="true"/>
</target>
You can create a env.bat file (if your on windows) 您可以创建一个env.bat文件(如果在Windows上)
inside you would include this: 在内部,您将包括以下内容:
SET JAVA_HOME=C:\java\jdk1.5
then you would do something like this: 那么您将执行以下操作:
env.bat
ant -f build.xml all
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.