You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by hezjing <he...@gmail.com> on 2007/07/17 05:01:09 UTC

Select JDK compiler

Hi!

I have projects to be compiled with Java 1.4, or Java 1.5 and how can
I explicitly select the compiler in build.xml?

When I set fork="yes" when calling <javac>, how do I know which JDK
compiler the <javac> is executing?

There are Java 1.4 and 1.5 installed in my environment, with JAVA_HOME
pointing to Java 1.5.


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Select JDK compiler

Posted by Roman Ivashin <ir...@gehtsoft.com>.
Hello!

  You can always use JDK 1.5.
  If you will need to compile project with java 1.4
  you can specify <javac source="1.4" target="1.4" ...>
  Of course, you can use properties here to avoid manual editing of build.xml:

  <javac source="${ant.build.javac.source}" target="${ant.build.javac.target}" ...>
  Built-in props "ant.build.javac.source" and "ant.build.javac.source" hold default value for JDK
  that is running Ant.

  When you need to compile with java 1.4 - just override these properties with
  your own values.

  Refer documentation of <javac> task for details.

>>> hezjing <he...@gmail.com> Tuesday, July 17, 2007, 10:01:09 AM wrote:

h> Hi!

h> I have projects to be compiled with Java 1.4, or Java 1.5 and how can
h> I explicitly select the compiler in build.xml?

h> When I set fork="yes" when calling <javac>, how do I know which JDK
h> compiler the <javac> is executing?

h> There are Java 1.4 and 1.5 installed in my environment, with JAVA_HOME
h> pointing to Java 1.5.




-- 
Yours sincerely
    Roman Ivashin
    Software developer
    GehtSoft group
Tuesday, July 17, 2007, 10:01 (GMT+6), Russia, Omsk
================================
       http://www.gehtsoft.com
email: iri@gehtsoft.com
phone: +7 3812 225 629 (ext. 306) (work)
icq:  158418242
 
All information contained in this e-mail is strictly confidential and
is only intended for use by the recipient.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Select JDK compiler

Posted by Sunil Prabhakaran <su...@gmail.com>.
hi Hezjing,

Try the executable attribute in <javac>.
By default it will be 1.5 for you.
however try setting this executable attribute to the filepath for 1.4
javac.exe, whereever you require the sources to be compiled with 1.4
JDK

hope this helps
regards
Sunil Prabhakaran

On 7/17/07, hezjing <he...@gmail.com> wrote:
> Hi!
>
> I have projects to be compiled with Java 1.4, or Java 1.5 and how can
> I explicitly select the compiler in build.xml?
>
> When I set fork="yes" when calling <javac>, how do I know which JDK
> compiler the <javac> is executing?
>
> There are Java 1.4 and 1.5 installed in my environment, with JAVA_HOME
> pointing to Java 1.5.
>
>
> --
>
> Hez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org