Slashdot Mirror


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."

6 of 37 comments (clear)

  1. Fun but not massively practical by dintech · · Score: 5, Insightful

    I've worked in a an environment where 1.4 and lower is mandatory. This was down to management believing that 1.5 was too new and 'untested' even though Sun obviously thought it production worthy.

    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. :)

  2. These have been around for years by ghoti · · Score: 4, Informative

    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
    1. Re:These have been around for years by hansamurai · · Score: 4, Interesting

      If only everybody has updated to 1.5. The middle tier of our online product where I work is running on 1.4.2 with just a rumbling of upgrading to 1.5. That upgrade probably won't occur for another year for various reasons that I'm not involved in. I think the bigger the company and the bigger the product, the slower the upgrading process is. I think some architects may even be fearful of 1.5, as I just joined a new project that is running on 1.4.2.13, and they started developing that just last November!

      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.

  3. the bleeding obvious... pointed out... by bitbucketeer · · Score: 5, Insightful

    Java 1.6 is out now. 1.5 is so, like, last year.

    1. Re:the bleeding obvious... pointed out... by Zonk+(troll) · · Score: 4, Informative

      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. -
  4. Retroweaver has more features than reported by xlv · · Score: 5, Informative

    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