A Funny Java Flavoured Look at the World

Tuesday, November 07, 2006

They were using Java 5 but they weren't using Java 5

Recently the developers where I work moved up to using Java 5 from Java 1.4. I was the last to know which was ironic because I had to learn about all the new features to pass the SCJP 5 exam and was eager to use them. By the way there is lots of information on Java 5 new features and SCJP 5 stuff on this site, just search the blog for whatever you are looking for and it will point you to free sample chapters, my ramblings and other sources of information, I even use it myself.

I wasn't sure about jumping up to Java 5 so quickly (our there any side effects), would it have any effect asking all our customers to make sure they are using Java 5, well the ones who wanted the upgrade. Like many things installing Java 5 is very simple and it seems more scary than it is, so all in all I think it's a good thing. The main reason we did this was so we could use Tomcat 5. It isn't always easy to explain this to customers but most of the time they just say install it or we do it quickly before the IT Admin comes over to see what we are doing to his precious server.

Anyway we recently installed it, so then I started adding in Java 5 stuff, like generics and my favourites the new For loop. It all worked well in Eclipse because I was pointing to Java 5. Troubles occurred when I tried to get ant to build me a jar file. It took me ages of wrestling and mucking about with it. I found that the source element was still set to use 1.4 and then when I changed it, it plain blank refused to even admit there was such a thing as Java 5. After googling about for a morning I finally found that (going back to find it again) that in my Eclipse preferences, in the Ant/Runtime section they had these global variables and I think that in here it was pointing to an old Java 1.4 tools.jar. So I swapped this to use a Java 5 version and wahay I was compiling and jarring up like a good un.

The funny point came recently when one of the other developers practically yelled in shock when he came face to face with a generic angled bracket - "what's that, how does it compile, what does it do" he shouted. You see they were using Java 5 but they weren't USING java 5. At last my hours of study finally have some benefit. Has anyone else suddenly come across some new code, new features that appeared out of now where and scared the life out of you.


If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

0 Comments:

Post a Comment

<< Home