• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant Javac Task with difrrerent compiler

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting problem in compiling java files using ANT,i am using jdk1.5 but i need to compile and generate classes using jdk1.4/jdk1.3,plzz help
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This FAQ might help:

http://bobcat.webappcabaret.net/javachina/faq/ant_01.htm#ant_mid_Q090
 
Vincy Kaczanowski
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this link,not that helpful,i am trying this but not able to reconize the javac.exe path
<javac srcdir="MYWeb/JavaSource"
destdir="MYWeb/WebContent/WEB-INF/classes"
debug="on"
verbose="on"
source="${source.level}"
target="1.4"
compiler="javac1.4"
fork="true"
executable="${javac.location}/javac.exe">
<classpath>
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
<include name="**/*.jar" />
</fileset>
<fileset dir="MYEAR">
<include name="**/*.jar" />
<include name="*.jar" />
</fileset>
</classpath>
</javac>
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vincy Kaczanowski:
I tried this link,not that helpful,i am trying this but not able to reconize the javac.exe path



I guess you did set them in your property file.

ant does not know anything unless you tell it.

1) In my build.properties (read first)
jdk13.bin=${tools.home}/jdk1.3.1_13/bin
jdk14.bin=${tools.home}/j2sdk1.4.2_08/bin/

2) In my master properties file (read last), set default
javac.location=${jdk13.bin}

3) In my prj.properties, if I need to use 1.4
javac.location=${jdk14.bin}

4) in my javac task
executable="${javac.location}/javac.exe"

Adjust the values according to your own environment.

Good luck!
 
Vincy Kaczanowski
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set all these properties not working on ant 1.5 ,i have changed ant version to 1.6 it is working now ,Thanks
 
Nothing? Or something? Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic