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)
Re:Retroweaver (Score:4, Interesting)
Personally I'm a bit frustrated by this being a noteworthy topic... I'm a Java dev and I really wish accomodating pre-java 5 JVMs wasn't ever needed. Reminds me too much of web development.
Re: (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 so
Re: (Score:3, Informative)
Fun but not massively practical (Score:5, Insightful)
These kind of people would be very scared if you tried to write code using 1.5, recompile the byte code using some new-ish open source toolkits and then putting it in to production. Then again, you could do it without telling anyone.
Re: (Score:3, Interesting)
So to add mouse-wheel support to our applet for those actually using a
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:1)
This was down to management believing that 1.5 was too new and 'untested' even though Sun obviously thought it production worthy.
I love Java just as much as the next guy but just because Sun releases it into production doesn't mean there won't be regressions, new bugs, security alerts released saying move up to _xx to fix the problem, and then more of the same is found in the "fixed" release.
These kind of people would be very scared if you tried to write code using 1.5, recompile the byte code using some new-ish open source toolkits and then putting it in to production. Then again, you could do it without telling anyone. :)
I wouldn't want to work in an environment where someone, or some build system WOULDN'T notice this kind of change. Don't get me wrong, I'm one of the guys who wants to upgrade; I just know it needs to be done carefully, and I have also s
Re: (Score:1)
Then you will be a convenient scapegoat for any particular calamity that occurs on the project. Performance problems, client goes out of business, server room on fire- you name it.
These have been around for years (Score:5, Informative)
Re: (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:These have been around for years (Score:5, Interesting)
Anyways, Java 5 has some great features but nothing that is absolutely required from my department's point of view. Autoboxing is a nice feature that helps clean up your code, but nothing we can't do now. Same for the new for-each loop. I could go on but this has been discussed to death already. I would rather we just upgrade so we can start taking advantage of the new features and supposed speed increases.
Re: (Score:2, Interesting)
I agree with the former, at least. I work for a fairly large organization where nothing terribly critical or large is running on Java, but they still won't standardize, so some things run JVM, some run 1.3, some 1.4, and several apps need specific patch levels of 1.3 or 1.4.
Re: (Score:3, Informative)
Of course, this depen
Re: (Score:3, Informative)
Generics are really the important feature. Replacing "Map" with "Map<String, List<MyDetail>>" is really significant for being able to tell what the code is supposed to be doing and making it work correctly and reliably.
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/gett
Re: (Score:1)
the bleeding obvious... pointed out... (Score:5, Insightful)
Re:the bleeding obvious... pointed out... (Score:4, Informative)
Re: (Score:1)
I am sure massively popular apps like Azureus, Limewire are already using such stuff mentioned in article.
Autoboxing (Score:4, Funny)
Re: (Score:1)
Another option (Score:2)
jsr14 compiler target (Score:3, Informative)
javac -source 1.5 -target jsr14
Re: (Score:3, Informative)
cldc1.0 (Score:3, Informative)
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
Is it just me (Score:2)
Misinformation about Retroweaver (Score:4, Interesting)
Disclosure: I'm the Retroweaver author.
The article seems to miss all of the features that Retroweaver has added over the past year. I think the author may not have been paying attention to the active releases on-going with Retroweaver. For example, Retroweaver supports every feature that the author purports is specific to Retrotranslator.
I have been spending less of my personal time on Retroweaver over the past year, but Xavier Le Vourch [sourceforge.net] has been doing an excellent job improving Retroweaver over that period.
Still stuck with old URLConnection (Score:2)
Java on Mac (Score:1)
Retroweaver is a great tool that allows me to use the language features of Java 1.5. I miss the improved 1.5 standard classes, ie. the improved string manipulation (String.format() with printf formatting for instance). At least I get a warning from Retroweaver..
Re: (Score:2)
Xavier