ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Natalia Bello <>
Subject Using a different jdk from the default one!!!!
Date Tue, 06 Nov 2001 16:45:04 GMT

Hello all!
i have a question about using differents jdks from Ant.
my problem is: i need to compile some java files with jdk1.2.2. These java
files use some classes that in jdk1.3 are included in rt.jar but not in
So i compile the files setting build.compiler to classic and providing the
path to the jdk1.2.2 rt.jar and tools.jar. and setting the specific
properties to no.Here is the code:

       <ant antfile="build-basic.xml" target="compile-classic">        
                <property name="build.compiler" value="classic"/>

   and in the build-basic.xml i have the target compile-clasic:
   <target name="compile-classic" >   
        <antcall target="prepare-compile"/>
	<javac   srcdir="${java.src.dir}"
 	            <pathelement path="C:\jdk1.2.2\lib\tools.jar"/>
	            <pathelement path="C:\jdk1.2.2\jre\lib\rt.jar"/>
                  <pathelement path="${optional.class.path}"/>

I can compile, and i have no errors; but when i try to run the jar file in a
machine with only jdk1.2.2 i have an error that say that it cant not find
the class ( the one that in jdk1.3.3 is included). I dont understand,
because if i use jdk1.2.2. to compile all it works fine ( that is it compile
and run with no problem)
I have tried some others combinations like set the java.home property before
calling compile-classic, use bootclasspath instead of classpath, use target;
but i havent success!!
does anyone know what i am doing wrong?? please any help or idea will be
very appreciated!!
thanks in advanced!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message