Using Java 5 Features in Older JDKs 37
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."
Retroweaver (Score:2, Informative)
These have been around for years (Score:5, Informative)
Re:These have been around for years (Score:1, Informative)
Moving a large infrastructure to a new JDK, while a Really Good Idea, is non-trivial and can be very expensive.
Re:the bleeding obvious... pointed out... (Score:4, Informative)
jsr14 compiler target (Score:3, Informative)
javac -source 1.5 -target jsr14
Retroweaver has more features than reported (Score:5, Informative)
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
Re:Retroweaver (Score:2, Informative)
If I understand correctly, Generics are backwards compatible because of how they get compiled. As long as your development machine supports generics, you don't have to worry about them on older JVMs!
This is about doing the development on older JVMs. This isn't a backwards compatibility issue in Generics themselves as much as a "If you already have backwards compatibility issues, but want X, here's how to do it."
But I'm inclined to say if you have problems with JVM versions, you're either doing something wrong and funky or you're trying to develop too much on the bleeding edge.
Re:Retroweaver (Score:3, Informative)
Re:jsr14 compiler target (Score:3, Informative)
Re:These have been around for years (Score:3, Informative)
Of course, this depends on figuring out how all your current code actually works, which can be a major undertaking.
cldc1.0 (Score:3, Informative)
Re:These have been around for years (Score:3, Informative)
Of course, this depends on figuring out how all your current code actually works, which can be a major undertaking.
Yep, this is a step in the right direction. Then we just need the rest of the C++ template features, and we might be approaching something that approaches being a nice language. Like not throwing out half the types during runtime... how silly is that? Getting rid of that terrible Collection framework and replacing it with something STL like (improving the STL interface with a Range class) would be a nice bonus. Oh, and I can have a lambda function, too? And operator overloading. And ruby like setters/getters? Multiple inheritance, or at least mixins, too. And if it could actually make coffee..?
Man, Java
Yes, I love that quote. Describes so much software I dislike :D
Re:Fun but not massively practical (Score:3, Informative)