ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <>
Subject Re: Javac target="1.4" not complaining about a method new in 1.5
Date Sat, 04 Dec 2004 02:19:42 GMT
Wendy Smoak <> wrote on 12/03/2004 04:44:12 PM:

> 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.

The documentation for @target says:

"Generate class files for specific VM version (e.g., 1.1 or 1.2). Note 
that the default value depends on the JVM that is running Ant. In 
particular, if you use JDK 1.4+ the generated classes will not be usable 
for a 1.1 Java VM unless you explicitly set this attribute to the value 
1.1 (which is the default value for JDK 1.1 to 1.3)."

The target attribute determines the class file version & JLS 
compatibility; it has nothing to do with the API that you are compiling 
against. If your appserver is running JDK 1.4.2 I would suggest that you 
put 1.4.2 on your development box.

Jeffrey E. Care (
WebSphere Build SWAT Team Lead
WebSphere Build Tooling Lead (Project Mantis)
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message