T
Tim Tyler
Dale King said:Tim Tyler wrote:
I hear you! I had the same reaction. I too thought that the reason that
they did generics the way they did was to have that backward
compatibility (Sun oddly calls this forward compatibility). I thought it
was going to be like the way nested classes were introduced. Nested
classes were introduced in 1.1, but the generated classes could run in
earlier VM's. But such was never their intention. But then why did we
end up with the lousy implementation of generics?
Maybe so that we could use third party tools to fix up the output from
the compiler, when the compiler is too stupid to do it itself - by the
look of it :-|
I have been told that there is an undocumented way to do it. You specify
jsr14 as the target.
-target jsr14 compiles the code. However it then fails in the same
way as compiling for Java 1.5 fails - when I try it here. I haven't
checked to see if the resulting bytecode is identical.
And if I don't mention it someone else will mention
retroweaver which is an open source tool to do it
(but which is not really a solution in my opinion).
Thanks for alerting us to the existence of
http://retroweaver.sourceforge.net/
However - even producing 1.4-compatible bytecode is not going to cope with
the VMs that check for major bytecode version number changes - and reject
code if it crosses a boundary. All the Netscape 4.xx JVMs did that,
for example. Nothing after Java 1.3.1 is likely to work for them.