Note that provided your dependencies don't use JDK5 classes, javac
-target 1.4 won't somehow statically link against JDK5 code. It's the
nature of Java that all the linking is done at runtime. Provided all
your code compiles using -target 1.4 and you didn't use the 1.5 rt.jar
it'll all be fine.



This statement is a bit wrong.
linking (the method you invoke) is done at compile time.

for example:

StringBuffer sb1 = new StringBuffer();
StringBuffer sb2 = new StringBuffer();

sb1.append(sb2);

if you compile this with java 1.3 and run it on java 1.4
then sb1.append(sb2) will still call StringBuffer.append(Object)
and not the new method (of java 1.4) StringBuffer.append(StringBuffer)
only if you recompile it with java 1.4 then the new method is called.

But if you say that javac knows all the methods that are new for a specific
version
and does't use that when compiling (when using a old -source and -target
thing) then it should be fine.

johan

Reply via email to