--- Stefan Bodewig <[EMAIL PROTECTED]> wrote:
> On Tue, 29 Jan 2002, Zhendi Su <[EMAIL PROTECTED]> wrote:
> 
> > I basically switched the compilers by typing:
> > 
> > setenv JAVA_HOME  /local/java/jdk1.1.8, or
> > setenv JAVA_HOME  /local/java/jdk1.2.2
> > 
> 
> This should work (and you don't need to put classes.zip into the
> classpath property explicitly), but you have to make sure you are
> really running the correct version of java as well.  No matter what
> you set JAVA_HOME to, if you run the java executable of JDK 1.2, it
> will use the compiler of JDK 1.2, or at least try to.

You can compile against 1.1.8 classes while running Ant with JDK 1.2 (or
1.3) by turning off the system and Ant runtime classes and including the
1.1.8 classes in your classpath instead. For example:
    <target name="compile118">
    <javac
      includeJavaRuntime="no"
      includeAntRuntime="no"
      srcdir="${basedir}"
      destdir="${outdir}"
      includes="${file}">
      <classpath>
        <pathelement location="/usr/local/java/jdk118/classes.zip"/>
      </classpath>
    </javac>
  </target>

Alternatively, you can use:
  <property name="build.sysclasspath" value="ignore"/>
and eliminate the need to include the 'includeJavaRuntime' and
'includeAntRuntime' attributes. But since this is a project-wide property,
it's probably better to stick with the task-specific attributes.

Diane

=====
([EMAIL PROTECTED])



__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to