ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Javac target="1.4" not complaining about a method new in 1.5
Date Fri, 03 Dec 2004 21:44:12 GMT

I have Java 1.5 on my development machine, and just deployed a webapp to
the HP-UX server which has 1.4.2.  And it broke, because I used
String.replace(String,String) which is new in 1.5.

So I went back and changed my javac task to include target="1.4".  But
it still compiles with no errors.

    <!-- Normal build of application -->
    <target name="compile" depends="init">
        <javac srcdir="src" destdir="classes" deprecation="on" 
               debug="on" target="1.4">
            <classpath refid="compile.classpath"/>

Buildfile: build.xml
   [delete] Deleting directory
    [mkdir] Created dir:
    [javac] Compiling 26 source files to

One of those classes contains:
    String orgCode = "ASU";
    String fixedUrl = harrisUrl.replace( "ORG_CODE", orgCode );

??  I think it should have complained about that line, as the JVM on the
server did.  Or am I using 'target' incorrectly?  (Ant 1.6.2)

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message