Reputation: 67
I need to run my project on java 1.4 and
pmd and findbugs on java 1.5
So, i need to set java_home in my build xml.
Thanks in advance,
-Sravan
Upvotes: 4
Views: 13370
Reputation: 845
There is a attribute called "jvm" for the java-task:
<java jvm="PATH_TO_YOUR_VM" fork="true"...>
...
</java>
Upvotes: 4
Reputation: 21
Alternatively, if you are in Windows, you could create 2 batch files: one that sets JAVA_HOME to 1.3 followed by your call to ant, a second one that sets JAVA_HOME to 1.4 followed by your call to ant. ex:
startAnt1.3.bat:
SET JAVA_HOME=C:\Java1.3\etc.
ant myTarget
startAnd1.4.bat:
SET JAVA_HOME=C:\Java1.4\etc.
ant myTarget
Upvotes: 0