Re: how to set JAVA_HOME in antscript build.xml

"Naina Dani" <[email protected]> Wed, 2 Jul 2008 12:00:25 -0500
Newsgroups gmane.comp.java.anthill
Message-ID <[email protected]>
--===============1610484201==
Content-Type: multipart/alternative; 
	boundary="----=_Part_1029_17300368.1215018026006"

------=_Part_1029_17300368.1215018026006
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi Kenneth,

Thanks for the help.
The solution you have suggested seems good, but, I have two different
environments: Solaris and Windows. So, if I hardcode in the build.xml (
executable="${jdk1.4}/bin/javac">), windows will have a problem compiling
the code as it will not find the javac in the hardcoded location. Does
anybody has a workaround for this ?

Thanks and Regards,
Naina.


On Tue, Jul 1, 2008 at 5:06 PM, Kenneth Burgener <[email protected]>
wrote:

> On 7/1/2008 2:25 PM, Naina Dani wrote:
>
>> So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME
>> is set depending on the project being built. Can anybody give me an idea how
>> to do this ?
>>
>
>
> We have an old project that had to be built with the 1.4 compiler.  To do
> this we used the "executable" parameter to the javac task.
>
>
> <javac srcdir="${project.test}"
>  destdir="${build.test}"
>  source="1.4"
>  target="1.4"
>  debug="on"
>  deprecation="off"
>  optimize="on"
>  fork="yes"
>  executable="${jdk1.4}/bin/javac">
>  <classpath>
>     ...
>  </classpath>
> </javac>
>
>
> This might work for you.
>
> Kenneth
>
> _______________________________________________
> Anthill mailing list
> Anthill-IWHQxnLZ/[email protected]
> http://lists.urbancode.com/mailman/listinfo/anthill
>

------=_Part_1029_17300368.1215018026006
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<br>Hi Kenneth,<br><br>Thanks for the help. <br>The solution you have suggested seems good, but, I have two different environments: Solaris and Windows. So, if I hardcode in the build.xml (&nbsp;
 executable=&quot;${jdk1.4}/bin/javac&quot;&gt;), windows will have a problem compiling the code as it will not find the javac in the hardcoded location. Does anybody has a workaround for this ?<br><br>Thanks and Regards,<br>
Naina.<br><br><br><div class="gmail_quote">On Tue, Jul 1, 2008 at 5:06 PM, Kenneth Burgener &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 7/1/2008 2:25 PM, Naina Dani wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So I want to set JAVA_HOME in build.xml of the project, so that JAVA_HOME is set depending on the project being built. Can anybody give me an idea how to do this ?<br>
</blockquote>
<br>
<br></div>
We have an old project that had to be built with the 1.4 compiler. &nbsp;To do this we used the &quot;executable&quot; parameter to the javac task.<br>
<br>
<br>
&lt;javac srcdir=&quot;${project.test}&quot;<br>
 &nbsp;destdir=&quot;${build.test}&quot;<br>
 &nbsp;source=&quot;1.4&quot;<br>
 &nbsp;target=&quot;1.4&quot;<br>
 &nbsp;debug=&quot;on&quot;<br>
 &nbsp;deprecation=&quot;off&quot;<br>
 &nbsp;optimize=&quot;on&quot;<br>
 &nbsp;fork=&quot;yes&quot;<br>
 &nbsp;executable=&quot;${jdk1.4}/bin/javac&quot;&gt;<br>
 &nbsp;&lt;classpath&gt;<br>
 &nbsp; &nbsp; ...<br>
 &nbsp;&lt;/classpath&gt;<br>
&lt;/javac&gt;<br>
<br>
<br>
This might work for you.<br><font color="#888888">
<br>
Kenneth</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Anthill mailing list<br>
<a href="mailto:Anthill-IWHQxnLZ/[email protected]" target="_blank">Anthill-IWHQxnLZ/[email protected]</a><br>
<a href="http://lists.urbancode.com/mailman/listinfo/anthill" target="_blank">http://lists.urbancode.com/mailman/listinfo/anthill</a><br>
</div></div></blockquote></div><br>

------=_Part_1029_17300368.1215018026006--

--===============1610484201==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Anthill mailing list
Anthill-IWHQxnLZ/[email protected]
http://lists.urbancode.com/mailman/listinfo/anthill

--===============1610484201==--