Using Java 5 Features in Older JDKs
BlueVoodoo writes "Java 5 added a number of powerful language features: generics, enumerations, annotations, autoboxing, and the enhanced for loop. Even if you're stuck on JDK 1.4, you can still use generics. Use Java and theory to learn how."
Can't get to TFA for some reason, but isn't this the point of Retroweaver?
It's great that IBM is writing this, but these tools have been around for years. They basically came out the same time as the final release of Java 1.5 (or "5.0"), when many people realized that it would be tricky to deploy programs that were using the new features. By now, everybody should have updated to 1.5 anyway.
EagerEyes.org: Visualization and Visual Communication
Java 1.5 was released 09/29/2004, so it's over two years old. 1.6 was release 12/12/2006.
"The Federal Reserve is a fraudulent system."--Lew Rockwell
End The FED. -
You can use the undocumented, unsupported 'jsr14' target in javac to compile 1.4-compatible bytecode from 1.5 source. No need for Retroweaver or other tools:
javac -source 1.5 -target jsr14
I'm the current maintainer for Retroweaver and the article does not mention all the Retroweaver features:
...
Annotations are supported, the concurrent backport is used for the concurrent packages, runtime classes can provide support for new features or replace classes entirely,
I suppose the article is based on the 1.2.5 version and not the beta version(s). I guess I followed the Google model of having a really long beta cycle with a stable product...
Seeing the possible confusion with the Beta tag, I just decided to release the official 2.0 version earlier today.
Xavier
Just because it's production-ready for Sun's purposes doesn't mean it's fully tested and supported by your J2EE application server (for example.) If it's not supported, you're on your own if you have a problem. That's why corporations don't switch right away. As far as code is concerned, if it ultimately ends up being targeted for the 1.4 JVM for example, your unit tests should still work, you're not running your server out of spec, and there shouldn't be any problem IMO.